On Thu, Dec 02, 2010 at 01:47:44PM -0800, Paul Eggert wrote: > On 12/02/10 05:24, Andries E. Brouwer wrote: > > > In short: use lstat instead of stat. > > Yes, I also like this suggestion and it is definitely on the > List of Things to Do.
Good! > > Another small change I made to my copy of diff is that two regular > > files with a length of 0 bytes are not compared. Some programs make > > empty files of mode 0 and opening them fails, but the files do not differ. > > This has the problem that files like /proc/cpuinfo are mishandled. > For example: > > cp /proc/uptime /tmp > diff /proc/uptime /tmp > > That's why "diff" reads length-0 files. It used to behave as you > suggest, but we got bug reports. My diff does not fail here since /tmp/uptime does not have zero length. But yes, it sees no difference between /proc/meminfo and /proc/uptime. For me avoiding complaints about the (rather frequent) mode 0 empty files was more important. Andries
