Reputation: 1640
I've read a couple of questions and answers on SO before I finally decided to post the question myself.
My aim is to write a patcher, which checks certain content against some location with up-to-date files. It'd be best if it could download and upload as little as possible, but detect modified files and replace either complete files or - preferably - only binary deltas.
I thought about making checksums of chunks on the server-side and checking against them on the client and only getting those chunks, that have different checksums.
What I really want to know is the theoretical approach, because I read a bit into VCDIFF and other approaches, but I am not sure I understand them. Is there a common approach to this sort of question? Is the chunk-idea correct? How would I go about implementing it in C# or Java?
Thank you in advance!
Upvotes: 2
Views: 499
Reputation: 156928
Depending on the type of files (text, binary) you can use a diff algorithm to narrow down the changes you have to send.
One of our interns has done a study on version control management, and he came up with a diff algorithm based on some studies. Maybe it is useful to you.
You can find some literature over here:
If you want to send over files, I would go at least for checksum and length, since these are most certainly unique.
You could create a format like
Post it to the server. Let it return the changes if:
In all other cases, leave it.
Upvotes: 2