I want to create my own incremental backup solution using C#. How can I obtain the difference between two files (version 1 and version 2 of ABC.TXT) and then update ABC.TXT version 1 with the difference? Would appreciate some hints! Thank you!
views:
421answers:
4
A:
I'm not sure as to how exactly you would replace the 'difference' text as that could get quite complex. But for the initial checking, you could compare the file sizes.
The link below might help you out:
Dal
2009-10-07 08:08:07
Alex is asking about *incremental* backup (just copying the parts of a file that have changed) - knowing the file sizes are different is not much help in this case.
Mark B
2009-10-07 08:13:10
A:
Do you really need incremental backup? Is there any reason why you can't just replace version 1 with version 2?
And as Jon pointed, probably you'd better use an already existing and tested backup solution.
Konamiman
2009-10-07 08:10:15
A:
here are some articles to some diff algorithms explained in C#
Its not easy to get this algorithm right. I would suggest executing kdiff3 or some other good diffing tool in a background process rather than writing it yourself.
Andrew Keith
2009-10-07 08:12:17
+1
A:
Here's something I just Googled, might be helpful as a starting point:
Mark B
2009-10-07 08:14:33