]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: clarify stat the meaning of --format="%t %T"
authorPádraig Brady <P@draigBrady.com>
Tue, 12 Mar 2013 13:43:08 +0000 (13:43 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 22 Mar 2013 08:58:30 +0000 (08:58 +0000)
* src/stat.c (usage): Mention that the values are only
defined for character and block special files.
* doc/coreutils.texi (stat invocation): Likewise.
Also mention st_rdev.
Reported in http://bugs.gnu.org/13927

doc/coreutils.texi
src/stat.c

index c6b3b32261b025659149c4e93bdf63395fb9af6e..8f1df4525e148f20189548e50d45c215dd50fd2d 100644 (file)
@@ -11631,8 +11631,8 @@ The valid @var{format} directives for files with @option{--format} and
 @item %N - Quoted file name with dereference if symbolic link
 @item %o - Optimal I/O transfer size hint
 @item %s - Total size, in bytes
-@item %t - Major device type in hex
-@item %T - Minor device type in hex
+@item %t - Major device type in hex (see below)
+@item %T - Minor device type in hex (see below)
 @item %u - User ID of owner
 @item %U - User name of owner
 @item %w - Time of file birth, or @samp{-} if unknown
@@ -11645,6 +11645,11 @@ The valid @var{format} directives for files with @option{--format} and
 @item %Z - Time of last change as seconds since Epoch
 @end itemize
 
+The @samp{%t} and @samp{%T} formats operate on the st_rdev member of
+the stat(2) structure, and are only defined for character and block
+special files.  On some systems or file types, st_rdev may be used to
+represent other quantities.
+
 The @samp{%W}, @samp{%X}, @samp{%Y}, and @samp{%Z} formats accept a
 precision preceded by a period to specify the number of digits to
 print after the decimal point.  For example, @samp{%.3X} outputs the
index 232669811ff3f01d49aa426c29e628c00e3f9519..a1938a7d4865887e72895ea13fda570c649b04ef 100644 (file)
@@ -1393,8 +1393,8 @@ The valid format sequences for files (without --file-system):\n\
   %N   quoted file name with dereference if symbolic link\n\
   %o   optimal I/O transfer size hint\n\
   %s   total size, in bytes\n\
-  %t   major device type in hex\n\
-  %T   minor device type in hex\n\
+  %t   major device type in hex, for character/block device special files\n\
+  %T   minor device type in hex, for character/block device special files\n\
 "), stdout);
       fputs (_("\
   %u   user ID of owner\n\