Let's say I have a 4 GB file abc on my local computer. I have uploaded it to a distant server via SFTP, it took a few hours.
Now I have slightly modified the file (probably 50 MB maximum, but not consecutive bytes in this file) locally, and saved it into abc2. I also kept the original file abc on my local computer.
How to compute a binary diff of abc and abc2?
Applications:
I cancould only send a
patchfile (probably max 100MB) to the distant server, instead of reuploading the wholeabc2file file (it would take a few hours again!), and recreateabc2on the distant server fromabcandpatchonly.Locally, instead of wasting 8 GB to backup both
abcandabc2, I could save onlyabc+patch, so it would take < 4100 MB only.
How to do this?
PS: for text, I know diff, but here I'm looking for something that could work for any raw binary format, it could be zip files or executables or even other types of file.
PS2: If possible, I don't want to use rsync ; I know it can replicate changes between 2 computers in an efficient way (not resending data that has not changed), but here I really want to have a patch file, that is reproducible later if I have both abc and patch.