Source-Changes archive

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

CVS commit: src/usr.bin/stat



Module Name:    src
Committed By:   kre
Date:           Wed Jun 22 18:20:30 UTC 2022

Modified Files:
        src/usr.bin/stat: stat.1 stat.c

Log Message:
Some corrections to stat to make it more reasonable, and comply with
the man page, in particular, in one of the EXAMPLES it is claimed:

     This example produces output very similar to that from find ... -ls
     (except that find(1) displays the time in a different format, and find(1)
     sometimes adds one or more spaces after the comma in “major,minor” for
     device nodes):

and then uses %9Z in the format, but conveniently does not use a
device file to demonstrate.

If it had, the result would have been:

   8033      0 brw-r-----    1 root              operator                  4,       51 Jun  8 02:44:45 2022 /dev/sd3

Note the spaces which were claimed to exist (sometimes) in find(1) output
but not with stat.   Oops.

Omitting those spaces seems like a good idea, so does using the same
field width for the result in both cases, rather than producing 9 chars
in the ordinary file case, and 19 (2 * 9 + 1) in the device case (for %9Z).

Now we will get:

   8033      0 brw-r-----    1 root              operator             4,51   Jun  8 02:44:45 2022 /dev/sd3

While here, also make the file number (%@) when reading stdin be 0, it is
not the 1st file in the arg list.

Some (very minor) KNF applied at the same time.

In stat.1 make these changes explicit.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/stat/stat.1
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/stat/stat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index