bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug in od with "-j" option?


From: Paul Eggert
Subject: Re: Bug in od with "-j" option?
Date: Tue, 14 Aug 2007 11:23:08 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Jim Meyering <address@hidden> writes:

> +          If the number of bytes left to skip is larger than
> +          the size of the current file, we can decrement
> +          n_skip and go on to the next file.  */
>         if (S_ISREG (file_stats.st_mode) && 0 <= file_stats.st_size)

An idle thought.  Given the problems we've had elsewhere with /proc
files that claim to be regular files of size zero, perhaps the above
line should be changed to the following?

          if (S_ISREG (file_stats.st_mode) && 0 < file_stats.st_size)

More generally, the idea is that if a file claims to be a regular file
of size zero, then GNU utilities should not attempt to do
optimizations based on the assumption that the file is empty, but
should go ahead and try to actually read the file.  It's kind of a
pain to treat size-zero files specially, but there it is.




reply via email to

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