tags:

views:

443

answers:

4

Say I have a big file in one directory and an older version of it in another. Is it somehow possible to update the older version with only the changes in the new one? So that I would copy only a small fraction from one place to another. Would have to work for both text and binary files.

Not sure if this is possible though, but curious to if it is.

+2  A: 

Hi, i don't see any gained from such thing because to see difference between two files you must read the whole files and compare them . I don't think this will be faster than just copying them Best Regards, Iordan

IordanTanev
Yeah, that was kind of what I was wondering about as well. So I guess I will keep it simple =)
Svish
not necessarily true.Saved bandwidth might be the deciding factor.
DmitryK
A: 

Hi,

May be a part of solution can be found with Sync Framework. http://msdn.microsoft.com/en-us/sync/default.aspx

A sample: http://www.c-sharpcorner.com/UploadFile/mail2sharad/FileSyncProvider01012008193150PM/FileSyncProvider.aspx

Hope this help.

Xstahef
A: 

Sure! There are plenty of diff implementations.

Just adapt them to your needs.

DmitryK
These seems to be for text files though?
Svish
doesn't matter. The algorithm works for any character sequences.
DmitryK
A: 

What you're describing is exactly what rsync is best at. Use the tool best suited to the problem.

Eric Smith