bdiff - Overview

bdiff is a command-line utility which compares two binary files ("base" and "derived") and creates a patch file that can be used to transform the base file into the derived file (with the antagonistical tool "bpatch"), similiar to what "diff" and "patch" do for text files. If the two files are related (e.g. the derived file is a newer version of the base file), the patch will (especially if compressed afterwards) typically be far smaller than the derived file.

In contrast to diff/patch, bdiff/bpatch:

+

Process >all< binary files correctly, whereas "diff -a" fails on many (should bdiff/bpatch fail to handle one, it's a bug)

+

Produce substantially smaller patches for those binary files where "diff -a" succeeds

-

Patches are not human-readable (even if text files are "diffed")

-

The base file used for "bdiff" and that used for "bpatch" must have exactly the same content - "bpatch" cannot "merge changes"

-

Only single-file uni-directional patches can be created (but I have two simple "directory diff" scripts to offer that utilize bdiff rsp. bpatch)

-

bdiff is much slower than diff (processes about 10-15 megabytes per minute on my PC) and currently needs large amounts of memory for satisfactory results (that is, small patches) on larger files (update: now only holds for suffix tree 'CVS branch')

Similiar to most ("normal") compression programs, patching is substantially faster than creating a patch and requires much less memory.

SourceForge.net Logo