Andreas Schwab wrote: > Jim Meyering <[email protected]> writes: > >> Sure, but that's not the question. >> The question is whether we can assume short-read-on-regular-file >> implies EOF. > > I think you can look at it as if you are reading a growing file.
Makes sense. But if a regular file is growing, then it's stat.st_size changes. For files in /proc, stat.st_size is always 0. If it is implemented that way, then it would be better to hide such counter-intuitive details from applications. Already, the fact that st_size is 0 for a known- and usually constant-sized, non-empty file is misleading -- probably contrary to POSIX, too, given the definition of st_size for a regular file. I wonder what would break if those types were changed from S_IFREG to S_IFIFO. One drawback might be that files in /proc are currently seekable. FIFO's aren't. It's a good thing that so few of the files in /proc are large enough to be affected. _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
