From 41de1a4309afbfb35f7c268413e1b53bbf9176a1 Mon Sep 17 00:00:00 2001 From: jay Date: Sat, 3 Jan 2004 21:14:28 +0000 Subject: [PATCH] Improved the documentation for the %k and %b format specifiers to -printf (Savannah bug #5034). Also pointed out that this handling is different to that used by the "b" and "k" suffixes with "-size". --- doc/find.texi | 11 ++++++++--- find/find.1 | 8 +++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/find.texi b/doc/find.texi index cc9504a..d7800b9 100644 --- a/doc/find.texi +++ b/doc/find.texi @@ -666,7 +666,9 @@ kilobytes (1024 bytes) @end table The size does not count indirect blocks, but it does count blocks in -sparse files that are not actually allocated. +sparse files that are not actually allocated. This handling of sparse +files differs from the output of the @samp{%k} and @samp{%b} format +specifiers for the @samp{-printf} predicate. @end deffn @deffn Test -empty @@ -1135,9 +1137,12 @@ File's permissions (in octal). @table @code @item %k -File's size in 1K blocks (rounded up). +Amount of disk space occupied by the file, measured in 1K blocks +(rounded up). This can be less than the length of the file if +it is a sparse file (that is, it has ``holes''). @item %b -File's size in 512-byte blocks (rounded up). +File's size in 512-byte blocks (rounded up). This also can be less +than the length of the file, if the file is sparse. @item %s File's size in bytes. @end table diff --git a/find/find.1 b/find/find.1 index 295b73e..18909d5 100644 --- a/find/find.1 +++ b/find/find.1 @@ -196,9 +196,11 @@ but not `b.*r3'. .IP "\-size \fIn\fR[bckw]" File uses \fIn\fP units of space. The units are 512-byte blocks by default or if `b' follows \fIn\fP, bytes if `c' follows \fIn\fP, -kilobytes if `k' follows \fIn\fP, or 2-byte words if `w' follows \fIn\fP. -The size does not count indirect blocks, but it does count blocks in -sparse files that are not actually allocated. +kilobytes if `k' follows \fIn\fP, or 2-byte words if `w' follows +\fIn\fP. The size does not count indirect blocks, but it does count +blocks in sparse files that are not actually allocated. Bear in mind +that the `%k' and `%b' format specifiers of \-printf handle sparse +files differently. .IP \-true Always true. .IP "\-type \fIc\fR" -- 2.11.4.GIT