Functions4U Reference. BSDiff
|
|
BSDiff functions permit to:
- Compare two binary or text files to get a new differences file (patch)
- Create a new file based in an old version and a file with the differences (patch)
Patch file size is related with the size of the change in original file compared with the file full size. Small changes let to get small patch files too.
In arithmetical notation it would be:
BSDiff does: patchfile = newfile - oldfile
BSPatch does: newfile = oldfile + patchfile
BSDiff is a BSD licensed binary diff/patch utility written by Colin Percival (Copyright 2003-2005 Colin Percival <cperciva@freebsd.org>), ported to Win32 by Andreas John <dynacore@tesla.inka.de>.
BSDiff/BSPatch functions are a light wrapper to BSDiff utilities.
bool BSDiff(String oldfile, String newfile, String patchfile)
Takes oldfile and newfile, compares them and put the differences in patchfile.so that it is possible to rebuild newfile.
In arithmetical notation it would be:
patchfile = newfile - oldfile
Returns true if correct. Error String can be got with BSGetLastError()
bool BSPatch(String oldfile, String newfile, String patchfile)
Takes oldfile and patchfile, to rebuild newfile.
In arithmetical notation it would be:
newfile = oldfile + patchfile
Returns true if correct. Error String can be got with BSGetLastError()
String BsGetLastError()
Returns the last BSDiff/BSPatch error message.
|