xdelta: Windows 下大文件比较(diff/patch)工具

Unix/Linux 系统下的 diff 和 patch 工具真的非常好用!
但是在 Windows 下似乎没有很好的替代工具(装 MinGW 方式除外)。

如果只是比较小文件,其实 Windows 下不缺工具,Beyond Compare、DiffMerge、UltraCompare,Tortoise SVN 也带有一个文件比对工具。
但是如果要对比两个 2G 的文件,90% 的工具都要废了,貌似他们都喜欢把要比对的文件完全加载到内存中,然后做可视化的比对。

最后找到的 xdelta 这个工具可以满足我的要求,项目地址:
http://code.google.com/p/xdelta/

命令行使用帮助:

E:\soft>xdelta3.0z.x86-32.exe –help
Xdelta version 3.0z, Copyright (C) 2007, 2008, 2009, 2010, Joshua MacDonald
Xdelta comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see “COPYING” for details.
usage: xdelta3 [command/options] [input [output]]
make patch:

xdelta3.exe -e -s old_file new_file delta_file

apply patch:

xdelta3.exe -d -s old_file delta_file decoded_new_file

special command names:
config prints xdelta3 configuration
decode decompress the input
encode compress the input
test run the builtin tests
special commands for VCDIFF inputs:
printdelta print information about the entire delta
printhdr print information about the first window
printhdrs print information about all windows
recode encode with new application/secondary settings
merge merge VCDIFF inputs (see below)
merge patches:

xdelta3 merge -m 1.vcdiff -m 2.vcdiff 3.vcdiff merged.vcdiff

standard options:
-0 .. -9 compression level
-c use stdout
-d decompress
-e compress
-f force (overwrite, ignore trailing garbage)
-h show help
-q be quiet
-v be verbose (max 2)
-V show version
memory options:
-B bytes source window size
-W bytes input window size
-P size compression duplicates window
-I size instruction buffer size (0 = unlimited)
compression options:
-s source source file to copy from (if any)
-S [djw|fgk] enable/disable secondary compression
-N disable small string-matching compression
-D disable external decompression (encode/decode)
-R disable external recompression (decode)
-n disable checksum (encode/decode)
-C soft config (encode, undocumented)
-A [apphead] disable/provide application header (encode)
-J disable output (check/compute only)
-T use alternate code table (test)
-m arguments for “merge”
the XDELTA environment variable may contain extra args:
XDELTA=”-s source-x.y.tar.gz” \
tar –use-compress-program=xdelta3 \
-cf target-x.z.tar.gz.vcdiff target-x.y

帮助里写得很详细了,我就不再作解释。

— EOF —

发表评论

电子邮件地址不会被公开。 必填项已用*标注