Large Binary Compare
I am trying to extract the Difference between 2 large data files.
I am currently Reading x bytes of each file into 2 buffers and performing a stricmp(file1buf, file2buf). If the 2 buffers are equal then I move on. However, if they are not equal then I have a very slow routine that searches, character-by-character, for where the files match up again.
This method is not good because of the possibility that there are unrelated parts in the files that appear identical to my pattern search.
Does anyone have any neat ways of finding a block in file A that does not exist in file B?
You could start by looking at the half of the file, comparing it, if the first half don't match then half it again, and so on untill you find a small code fragment, about 10charcters or so that don't match then find the one that is not matching.