I don't think so Alt255 - if it were that simple the money would be in the bank. <br>
<br>
Many of the files that will be compared are several GB in size - you aren't going to read those in a single leap. So, we read the file in smaller chunks. After we come to the first difference between buffers (strings?) the following scenario exists:<br>
i) the old file has simply been changed - easy, just read ahead until the bytes match again, writing the location and new byte value to the patch file,<br>
ii) the new file has been inserted into - sounds easy, just advance through the new file buffer until the bytes match again or you have come to the end of the buffer in which case read next chunk and repeat,<br>
iii) the new file has been deleted from, same as ii but move forward through the old file buffer,<br>
<br>
----- BUT -----<br>
<br>
when we come to the first difference we don't know whether it is a change, insert or delete. Should we move ahead through the old buffer or the new or perhaps both. What if the files don't match until the next read of the new file, or the old file, what if they only match up again after 30 reads of the new file. This is the part of the logic that isn't such a "piece of cake".<br>
<br>
One other point, when using strings remember that when you compare each element of the string you are actually comparing 2 bytes, not one. This is obviously overcome by using arrays of bytes.<br>
<br>
Mike, I had thought about the linux source, but the limitations you mention are the problem. The patch program sounds promising so I will try to track down the code for that.<br>
<br>
Thanks guys, please keep the thoughts coming, I need all the help I can get.