GNU bug report logs - #10561
stat unclear about size on disk and type of blocks discussed

Previous Next

Package: coreutils;

Reported by: Filipus Klutiero <chealer <at> gmail.com>

Date: Fri, 20 Jan 2012 07:18:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Filipus Klutiero <chealer <at> gmail.com>
Cc: 10561 <at> debbugs.gnu.org, Pádraig Brady <P <at> draigBrady.com>
Subject: bug#10561: stat unclear about size on disk and type of blocks discussed
Date: Tue, 07 Feb 2012 12:44:07 -0700
[Message part 1 (text/plain, inline)]
On 02/07/2012 12:20 PM, Filipus Klutiero wrote:
> 
> So are you saying that stat cannot display a file's size on disk?

Not without inventing a new % modifier, or else you doing the math
yourself.  So maybe it is worth adding a new one, as in:

%S  Allocated size (same as %b * %B)

>> I don't see any ambiguity. %b and %B are described in relation
>> to each other, which is all that's required.
> 
> That's not all that's required. Each directive should have a useful
> description, not just a circular definition.
>> See how each refers to the other in the docs:
>>
>>    %b     Number of blocks allocated (see %B)
>>    %B     The size in bytes of each block reported by %b
>>
> 
> I see that, but I fail to see how that would make the description of %b
> unambiguous. A file has a number of file system blocks allocated. I do
> not see what would prevent a reader from interpreting %b as that number.

Maybe it would help to do things like:

%b   Number of blocks allocated (see %B), corresponds to st_blocks
%B   The size in bytes of each block reported by %b, or st_blksize

for those that are familiar with the stat(2) interface.  For that
matter, tying ALL of the existing % modifiers back to struct stat
members might be handy.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 13 years and 185 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.