bug-coreutils
[Top][All Lists]
Advanced

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

Re: coreutils-5.1.2: patch for stat command: one small point


From: Jim Meyering
Subject: Re: coreutils-5.1.2: patch for stat command: one small point
Date: Mon, 02 Feb 2004 17:17:28 +0100

"Nelson H. F. Beebe" <address@hidden> wrote:
> I notice that the output of stat from coreutils-5.1.2 produces a blank
> line (marked by ---> below) at the end of its report:
>
>       203 eilat::coreutils-5.1.2.p1> /usr/local/bin/stat /bin/true
>         File: `/bin/true'
>         Size: 312             Blocks: 8          IO Block: 65536  regular file
>       Device: eeh/238d        Inode: 380         Links: 1
>       Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/     sys)
>       Access: 2003-12-09 09:02:56.572619600 -0700
>       Modify: 1999-11-04 12:07:38.887783200 -0700
>       Change: 1999-11-04 12:07:38.888253600 -0700
> --->
>       204 eilat::coreutils-5.1.2.p1>
>
> Spurious empty trailing lines are atypical of GNU and Unix software,
> so perhaps the empty line should be eliminated.

Yes, it should.  Thank you.
That's easy/safe to fix, so I'll do it now.

However, this raises the issue of a little wart in stat:
even though one may specify the --format=FORMAT, stat always
outputs a trailing newline.  IMHO, it'd be better to have stat
omit the default trailing newline with a user-supplied FORMAT.
It might even be worthwhile to interpret `\n', \t, \\, etc.

Although it's been around for a while, stat is a relatively new addition
to coreutils.  Perhaps now is the best time to make such a change.  I can
see that it might well cause trouble in applications that require the
automatically-supplied trailing newline, but there may not be too many,
yet, and the documentation is silent on the matter, so it's not as if
they're relying on a published interface...

Comments welcome.

Bear in mind that making such a change will become only harder the longer
we wait.




reply via email to

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