5

Let's say I have two folders: before and after.

./before:
bash

./after:
bash

The bash in the before folder differs from the bash in after.

Using bsdiff or a similar program, is there a way to create a binary patch between the two folders? The program does not have to support Windows. New files in the after directory need to be included with the patch file as well.

The reason I don't want to package after as a whole is to minimize the size of the patch.

2
  • What is your goal in making a patch rather than simply taring up after? Just minimizing the size, or do you also expect something sensible to happen if the patch is applied to a directory tree that is slightly different from before? Apart from file names and contents, do you need to preserve metadata (timestamps, ownership, etc.)? Commented Jun 14, 2016 at 21:37
  • I want to minimize the size of my patch for convenience. And no, I don't need to preserve timestamps and ownership. Commented Jun 14, 2016 at 21:40

1 Answer 1

2

The xdelta program does exactly what you are looking for:

Name : xdelta

Description : Xdelta (X for XCF: the eXperimental Computing Facility at Berkeley) is a binary delta generator (like a diff program for binaries) and an RCS version control replacement library. Xdelta uses a binary file delta algorithm to replace the standard diff program used by RCS

2
  • It appears this doesn't support folders, though there seems to be some type of perl script that accomplishes this task. Commented Jun 14, 2016 at 20:48
  • That program worked exactly as I wanted it to, and it helped me even further with the xdelta3-dir-patcher wrapper program. Commented Jun 15, 2016 at 1:48

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.