bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature req for diff


From: Paul Eggert
Subject: Re: feature req for diff
Date: Fri, 29 Mar 2002 11:49:52 -0800 (PST)

> From: Koblinger Egmont <address@hidden>
> Date: Fri, 29 Mar 2002 12:49:52 +0100 (CET)
> 
> I'd really like to see an option for diff which I haven't found in the
> documentation. When comparing two very large directory structures (e.g.
> openoffice source :)  then a 'diff -ur' takes approx. half an hour on my
> machine. It would be very nice if an option told 'diff' to assume that two
> files with the equal size and timestamp have the same content.

Thanks for the this suggestion.  I'll add it to the to-do list.

I see a problem with this suggestion, though.  If you use 'cp -pr' to
make the directory copy, and if the file system supports sub-second
time stamps (which is becoming more common these days), and if 'cp'
can set time stamps only to one-second resolution (the typical case,
alas), then the performance optimization won't take effect because the
file time stamps will typically differ (by less than one second).
However, I guess this isn't a disaster, since it will merely make
'diff' slower, and will not break 'diff' entirely.

What I do in this situation is make all the source files read-only.
When I copy a directory hierarchy, I use hard or soft links to regular
files instead of copying the files.  When I want to edit a file in the
copy, I break the link.

If you do things that way, you'll get the performance improvement that
you desire without having to change 'diff'.  Some other programs will
run faster, too, e.g. 'cmp'.  You'll also save some disk space.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]