> Anyone happen to know if/how well Algorithm:Diff handles binary files, 

Very few utilities based on "C" runtimes handle files with embedded \0's
gracefully. Most written in Perl fall in that category.  There is nothing in 
http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/lib/Algorithm/Diff.pm
to suggest otherwise for this module.

Generally, with binary files, you don't want to know how the contents differ
but if they do; in which case, a checksum is more likely to work over the
binary data than a diff algorithm. IIRC, some of the Perl Checksum modules
will work on binary data ok, the Unix 'cksum' will too.  I've successfully
gotten compatible answers from Perl and a Checksum module to what Unix does
... picked the module comparing Unix and Module man pages.

If you need to know where in the binary files the differences are ... ugh. 
One way is to expand both files to Hex (via un/pack or whatever, see
Cookbook), and text diff ... but        
you need to think about what the natural "grouping" is.

> have a better suggestion for creating diffs of files? Files being of
> unspecified format and size, that is. Trying to cobble something together
> that's as generic as possible.

Generic as possible for binary ... no, you really need to assume SOME sort of
structure to know what the resyncronizing points are.
 
Funny though, this is the second time Algorithm::Diff has come up today ...
someone at work wanted to know about XML Diff, what were the options.

Bill
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to