Re: Why not diff binaries?

2000-07-19 Thread Pavel M. Penev


On 18 Jul 2000, Bruce Stephens wrote:

> "Pavel M. Penev" <[EMAIL PROTECTED]> writes:
> 
> > Can someone tell me a sensible reason for not having a 'diff'
> > equivalent for binary file?
> 
> What do you want to do?
> 
> If you want the following:
> 
> Given a binary (or text) file A and a variant of it A',
> generate a patch delta(A,A') representing the differences.
> 
> Then you can use xdelta.  With xdelta, you can construct and apply
> such binary patches.
> 
> diff is also used to generate human-comprehensible differences, and
> I'm not aware of a tool for doing this for binary files.  
> 
> I'm not sure such a program would be useful, but it probably would be
> for certain kinds of files.  For example, a diff that worked on
> (mostly) text-based files, but used a character-based approach rather
> than a line-based one could be very useful.  At one point algorithms
> for this weren't feasible (hence the line-based nature of diff), but
> IIRC, there's at least one algorithm which generates minimal
> differences in linear time (or thereabouts), for some definition of
> "minimal", so it ought to be usable at the byte level.
> 

Thank you all a lot. I have already been told aboult xdelta (and read its
manual); moreover I think a have seen something with more features (like
recusing into directories). I have what I need. I though this topic was
already closed.

Thaks again,
Pavel





Re: Why not diff binaries?

2000-07-18 Thread Bruce Stephens
"Pavel M. Penev" <[EMAIL PROTECTED]> writes:

> Can someone tell me a sensible reason for not having a 'diff'
> equivalent for binary file?

What do you want to do?

If you want the following:

Given a binary (or text) file A and a variant of it A',
generate a patch delta(A,A') representing the differences.

Then you can use xdelta.  With xdelta, you can construct and apply
such binary patches.

diff is also used to generate human-comprehensible differences, and
I'm not aware of a tool for doing this for binary files.  

I'm not sure such a program would be useful, but it probably would be
for certain kinds of files.  For example, a diff that worked on
(mostly) text-based files, but used a character-based approach rather
than a line-based one could be very useful.  At one point algorithms
for this weren't feasible (hence the line-based nature of diff), but
IIRC, there's at least one algorithm which generates minimal
differences in linear time (or thereabouts), for some definition of
"minimal", so it ought to be usable at the byte level.



Re: Why not diff binaries?

2000-07-17 Thread Chris Majewski
Hm? I use diff on binaries all the time.. -chris


On 17 Jul 2000, Lee Willis wrote:

> [EMAIL PROTECTED] (Riku Saikkonen) writes:
> 
> > "Pavel M. Penev" <[EMAIL PROTECTED]> writes:
> > >Can someone tell me a sensible reason for not having a 'diff' equivalent
> > >for binary file?
> > 
> > There is "cmp", but it reports only the position of the first
> > differing byte (if any).
> 
> "cmp -l" will report all the differences I believe ...
> 
> Lee
> -- 
> | Lee Willis  Fixed cost Internet access available @
> | Application Developer  http://www.plus.net
> | PlusNet Technologies Ltd
> +---"PlusNet  - The smarter way to Internet"
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED] < /dev/null
> 



Re: Why not diff binaries?

2000-07-17 Thread Pavel M. Penev


On 17 Jul 2000, Riku Saikkonen wrote:

> "Pavel M. Penev" <[EMAIL PROTECTED]> writes:
> >Can someone tell me a sensible reason for not having a 'diff' equivalent
> >for binary file?
> 
> There is "cmp", but it reports only the position of the first
> differing byte (if any).
> 
> As for why not:
> 
>  * diff is helped a lot by the fact that the input is line-based text.
>And diff doesn't work very well if the lines are very short or
>there are lots of small changes inside lines.
> 
>I don't know if there are algorithms for detecting differences in
>streams of bytes (instead of lines); probably there are, but I
>don't know if they work as well as the text comparison algorithm in
>diff.
> 
>(There is also wdiff, which works word-wise, and seems to work okay
>for what it's designed: calculating differences between reformatted
>paragraphs of text.)
> 
>  * There isn't as much use for binary patches than for textual ones,
>because binary executables are platform-dependent.
> 
> It should be possible to dump the binary files in a textual format
> with "od" (use one byte or word per line, unless you know the data has
> larger structures that you want to compare as a whole) and run diff on
> those, but I don't know how well that would work.
> 
> -- 
> -=- Rjs -=- [EMAIL PROTECTED]
> 
> 
10X! I think I am going to continue my issues in another mail-list.

Gladly,
Pavel M. Penev




Re: Why not diff binaries?

2000-07-17 Thread Lee Willis
[EMAIL PROTECTED] (Riku Saikkonen) writes:

> "Pavel M. Penev" <[EMAIL PROTECTED]> writes:
> >Can someone tell me a sensible reason for not having a 'diff' equivalent
> >for binary file?
> 
> There is "cmp", but it reports only the position of the first
> differing byte (if any).

"cmp -l" will report all the differences I believe ...

Lee
-- 
| Lee Willis  Fixed cost Internet access available @
| Application Developer  http://www.plus.net
| PlusNet Technologies Ltd
+---"PlusNet  - The smarter way to Internet"



Re: Why not diff binaries?

2000-07-17 Thread Riku Saikkonen
"Pavel M. Penev" <[EMAIL PROTECTED]> writes:
>Can someone tell me a sensible reason for not having a 'diff' equivalent
>for binary file?

There is "cmp", but it reports only the position of the first
differing byte (if any).

As for why not:

 * diff is helped a lot by the fact that the input is line-based text.
   And diff doesn't work very well if the lines are very short or
   there are lots of small changes inside lines.

   I don't know if there are algorithms for detecting differences in
   streams of bytes (instead of lines); probably there are, but I
   don't know if they work as well as the text comparison algorithm in
   diff.

   (There is also wdiff, which works word-wise, and seems to work okay
   for what it's designed: calculating differences between reformatted
   paragraphs of text.)

 * There isn't as much use for binary patches than for textual ones,
   because binary executables are platform-dependent.

It should be possible to dump the binary files in a textual format
with "od" (use one byte or word per line, unless you know the data has
larger structures that you want to compare as a whole) and run diff on
those, but I don't know how well that would work.

-- 
-=- Rjs -=- [EMAIL PROTECTED]



Why not diff binaries?

2000-07-17 Thread Pavel M. Penev
Can someone tell me a sensible reason for not having a 'diff' equivalent
for binary file?

Regards,
Pavel M. Penev