Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to diff two very large files, far too large for diff to handle. rdiff can produce a delta file for them in a few seconds, but I'd like to have a real diff as output. Is there an existing way of converting an rdiff delta to a regular diff?

share|improve this question

1 Answer 1

I don't think this is (easily) possible. rdiff parses the files as chunks of bytes, generating a signature for fixed-size blocks of bytes. The new file is then compared to those signatures. The delta file contains all different blocks, which do not necessarily match lines in the original or compared file.

For instance, an original:

AAAAAAAAAA
BBBBBBBBBB
CCCCCCCCCC
DDDDDDDDDD

compared with:

AAAAAAAAAA
BBBBOOOBBB
CCCCCCCCCC
DDDDDDDDDD

could produce a delta:

[..]BOOOBBB
CCCCCCCCCCC
DDDDDDD[..]

Regular diff files usually contain all changed lines. The rdiff delta file will probably only a part of some changed lines, and a lot of unchanged lines as well. You would have to parse the file(s) again to determine the actual changed lines.

For more information, see the rdiff documentation or http://librsync.sourcefrog.net/doc/rdiff.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.