Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Delta Diff Patches of large Binary Files in C#

Tags:

c#

.net

diff

I looking for a way to create Delta Diff Patches of Large Binary Files (VMWare Virtual Disk Files). Is there an implementation in C# or any useful methods in the the .NET Framework.

Any help is appreciated. Thanks.

rAyt

like image 787
Henrik P. Hessel Avatar asked May 21 '09 10:05

Henrik P. Hessel


2 Answers

bsdiff was designed to create very small patches for binary files.

As stated on its page, it requires max(17*n,9*n+m)+O(1) bytes of memory and runs in O((n+m) log n) time (where n is the size of the old file and m is the size of the new file), so it will take a long time and use a huge amount of memory to create diffs for virtual disk files.

The original implementation is in C, but a C# port is described here and available here.

like image 148
Bradley Grainger Avatar answered Sep 20 '22 00:09

Bradley Grainger


There's nothing built into the framework to do this.

You're going to have to look for 3rd party solutions, commercial or free, or write your own.

A common algorithm is the VCDiff algorithm, which is used by quite a large number of products.

like image 26
Lasse V. Karlsen Avatar answered Sep 22 '22 00:09

Lasse V. Karlsen