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: Koblinger Egmont
Subject: Re: feature req for diff
Date: Sat, 30 Mar 2002 01:37:26 +0100 (CET)

Hi,


> 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.

Ohh, this sub-second timestamp sounds new to me. But I hope that as soon
there's a libc-api to ask the sub-second of the timestamp (is there?), cp
will soon support it.   Somehow I can't really imagine a system where such
a basic command as "cp" doesn't support sub-second precision, while a
more specialized developer tool such as "diff" does.

> 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.

Does diff check the inode and if it's the same, then skip this file? If it
does, it's perfect. If not, then it only reduces run time to 50% I'm
afraid.




bye
Egmont




reply via email to

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