Posted 06 September 2013 - 11:31 PM
Hello all.
I was bored just now, and decided to revisit an old problem that had stumped me before: the longest common subsequence problem, used in programs like in the "real" diff utility.
After doing a bit more reading on the LCS problem, I decided that I would try to implement it in CC. A few hours later, I created this.
It's a simple implementation of the diff and patch utilities used in Unix-likes. It's really simple to use:
The first command will create a diff of old_file and new_file, outputting the diff (and therefore patch) to patch_file.
The second command will patch copy_of_old_file to new_file, writing the "new" version of copy_of_old_file to copy_of_old_file.out.
It's only designed to work with text files.
It should work, though I can't make any promises; it's another of my "I'm-bored-so-rush-this" programs.
Anyways, links:
Diff: Pastebin (Code: CbKFJdaU)
Patch: Pastebin (Code: V1N1bRL2)
I was bored just now, and decided to revisit an old problem that had stumped me before: the longest common subsequence problem, used in programs like in the "real" diff utility.
After doing a bit more reading on the LCS problem, I decided that I would try to implement it in CC. A few hours later, I created this.
It's a simple implementation of the diff and patch utilities used in Unix-likes. It's really simple to use:
diff old_file new_file patch_file
patch copy_of_old_file patch_file
The first command will create a diff of old_file and new_file, outputting the diff (and therefore patch) to patch_file.
The second command will patch copy_of_old_file to new_file, writing the "new" version of copy_of_old_file to copy_of_old_file.out.
It's only designed to work with text files.
It should work, though I can't make any promises; it's another of my "I'm-bored-so-rush-this" programs.
Anyways, links:
Diff: Pastebin (Code: CbKFJdaU)
Patch: Pastebin (Code: V1N1bRL2)