Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Get the difference between two files and use it for incremental backup

Tags:

c#

io

backup

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!

like image 682
Alex Avatar asked Nov 06 '22 19:11

Alex


1 Answers

here are some articles to some diff algorithms explained in C#

Codeproject 1

Codeproject 2

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.

like image 196
Andrew Keith Avatar answered Nov 14 '22 21:11

Andrew Keith