GNU bug report logs - #10755
stat: Please add directive to display size on disk (%S)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: Filipus Klutiero <chealer@HIDDEN>; dated Tue, 7 Feb 2012 20:13:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Changed bug title to 'stat: Please add directive to display size on disk (%S)' from 'stat: Please add directive to display size on disk' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 10755 <at> debbugs.gnu.org:


Received: (at 10755) by debbugs.gnu.org; 7 Feb 2012 22:36:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 07 17:36:39 2012
Received: from localhost ([127.0.0.1]:59557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1RuteQ-0003JK-PL
	for submit <at> debbugs.gnu.org; Tue, 07 Feb 2012 17:36:39 -0500
Received: from mail-qy0-f172.google.com ([209.85.216.172]:40315)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <chealer@HIDDEN>) id 1RuteO-0003J5-1U
	for 10755 <at> debbugs.gnu.org; Tue, 07 Feb 2012 17:36:36 -0500
Received: by qcsg13 with SMTP id g13so481333qcs.3
	for <10755 <at> debbugs.gnu.org>; Tue, 07 Feb 2012 14:35:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=vHmUdzN+cZu9odQIpXzitBKHLJxUZzs51bd2bahexWY=;
	b=mRzllNKYMz1t5WE4lOU2DyRI373UgutqwxEylmOk/PXpZieKflueb7oMoToCPrJFrb
	LMGU+Qd+kw8FPCZmT3VzybIcBtcbSkcUZHNeS1m6lNCOvN+gF4wIJ9PYYOzMW/GVKLn4
	izjELj2lLA9eRZeY/wvwAEP0fBbliiBYYtwzQ=
Received: by 10.224.106.196 with SMTP id y4mr7323669qao.90.1328654132649;
	Tue, 07 Feb 2012 14:35:32 -0800 (PST)
Received: from [192.168.1.9] (modemcable156.191-56-74.mc.videotron.ca.
	[74.56.191.156])
	by mx.google.com with ESMTPS id eb5sm93875qab.10.2012.02.07.14.35.31
	(version=SSLv3 cipher=OTHER); Tue, 07 Feb 2012 14:35:31 -0800 (PST)
Message-ID: <4F31A72F.1030007@HIDDEN>
Date: Tue, 07 Feb 2012 17:35:27 -0500
From: Filipus Klutiero <chealer@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64;
	rv:8.0) Gecko/20120104 Icedove/8.0
MIME-Version: 1.0
To: 10755 <at> debbugs.gnu.org
Subject: Re: bug#10755: stat: Please add directive to display size on disk
References: <4F31854B.5050702@HIDDEN> <4F318F94.5010202@HIDDEN>
In-Reply-To: <4F318F94.5010202@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 10755
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

On 2012-02-07 15:54, Paul Eggert wrote:
> On 02/07/2012 12:10 PM, Filipus Klutiero wrote:
>> Size on disk
> We don't know it's a disk drive; it might be
> any storage device that contain a file system.

I agree. I see an advantage in using the term "Size on disk": it is well 
known from Windows ( 
http://technet.microsoft.com/en-us/magazine/hh148159.aspx ). But indeed, 
it does not always apply. It could be mentioned in a parenthesis and/or 
in quotes nevertheless to facilitate search.
> Perhaps a better shorthand string would be "Allocation"?
> That's even shorter, and it conveys what's going on.

Oh, good question. We currently have:

> Size: 54              Blocks: 8          IO Block: 4096

If we want to display the allocated size too, "Size" for "real"(?) size 
becomes clearly ambiguous. How about having a line for size? Something like

> Size    Real: 54    Allocated: 4096






Information forwarded to bug-coreutils@HIDDEN:
bug#10755; Package coreutils. Full text available.

Message received at 10755 <at> debbugs.gnu.org:


Received: (at 10755) by debbugs.gnu.org; 7 Feb 2012 20:55:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 07 15:55:52 2012
Received: from localhost ([127.0.0.1]:59442 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Rus4t-0007jn-VO
	for submit <at> debbugs.gnu.org; Tue, 07 Feb 2012 15:55:52 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:53497)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eggert@HIDDEN>) id 1Rus4r-0007jZ-6W
	for 10755 <at> debbugs.gnu.org; Tue, 07 Feb 2012 15:55:50 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 488BE39E800B;
	Tue,  7 Feb 2012 12:54:45 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id W8+c5Z1OJaos; Tue,  7 Feb 2012 12:54:44 -0800 (PST)
Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8A5EB39E800A;
	Tue,  7 Feb 2012 12:54:44 -0800 (PST)
Message-ID: <4F318F94.5010202@HIDDEN>
Date: Tue, 07 Feb 2012 12:54:44 -0800
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:9.0) Gecko/20111222 Thunderbird/9.0
MIME-Version: 1.0
To: Filipus Klutiero <chealer@HIDDEN>
Subject: Re: bug#10755: stat: Please add directive to display size on disk
References: <4F31854B.5050702@HIDDEN>
In-Reply-To: <4F31854B.5050702@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 10755
Cc: 10755 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

On 02/07/2012 12:10 PM, Filipus Klutiero wrote:
> Size on disk

We don't know it's a disk drive; it might be
any storage device that contain a file system.
Perhaps a better shorthand string would be "Allocation"?
That's even shorter, and it conveys what's going on.




Information forwarded to bug-coreutils@HIDDEN:
bug#10755; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Feb 2012 20:12:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 07 15:12:14 2012
Received: from localhost ([127.0.0.1]:59382 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1RurOg-0005uB-Ev
	for submit <at> debbugs.gnu.org; Tue, 07 Feb 2012 15:12:14 -0500
Received: from eggs.gnu.org ([140.186.70.92]:52808)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <chealer@HIDDEN>) id 1RurOe-0005ty-8W
	for submit <at> debbugs.gnu.org; Tue, 07 Feb 2012 15:12:13 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <chealer@HIDDEN>) id 1RurNZ-0001tr-OS
	for submit <at> debbugs.gnu.org; Tue, 07 Feb 2012 15:11:09 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([140.186.70.17]:49802)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <chealer@HIDDEN>) id 1RurNZ-0001tn-Mr
	for submit <at> debbugs.gnu.org; Tue, 07 Feb 2012 15:11:05 -0500
Received: from eggs.gnu.org ([140.186.70.92]:53788)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <chealer@HIDDEN>) id 1RurNV-0002Yd-IT
	for bug-coreutils@HIDDEN; Tue, 07 Feb 2012 15:11:05 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <chealer@HIDDEN>) id 1RurNR-0001t0-EO
	for bug-coreutils@HIDDEN; Tue, 07 Feb 2012 15:11:01 -0500
Received: from mail-qw0-f41.google.com ([209.85.216.41]:57662)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <chealer@HIDDEN>) id 1RurNR-0001sq-B6
	for bug-coreutils@HIDDEN; Tue, 07 Feb 2012 15:10:57 -0500
Received: by qadz32 with SMTP id z32so3341950qad.0
	for <bug-coreutils@HIDDEN>; Tue, 07 Feb 2012 12:10:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject
	:content-type:content-transfer-encoding;
	bh=61CrrYD1eHwipS4NcQvU1ZivgTq9bmOvqoVr/wavNgY=;
	b=hGQpmeQQVHcwJOvXAFHG/11FyN9DH8mpW/4iEJo86R9Gy7l900wD8jdJ6Q9S6WExv5
	0KFl0ceNXYK+Lj1S7j/2IkXA9HZ/BUHNa8FdH/ZXE6VqBH7NwzvjaT5DTIEs+dkigVF/
	wRqxZSzeioGQBr6m7k8G3cnc/thXS8BtwU+2E=
Received: by 10.229.76.23 with SMTP id a23mr10187695qck.100.1328645456583;
	Tue, 07 Feb 2012 12:10:56 -0800 (PST)
Received: from [192.168.1.9] (modemcable156.191-56-74.mc.videotron.ca.
	[74.56.191.156])
	by mx.google.com with ESMTPS id c2sm31742012qao.15.2012.02.07.12.10.55
	(version=SSLv3 cipher=OTHER); Tue, 07 Feb 2012 12:10:55 -0800 (PST)
Message-ID: <4F31854B.5050702@HIDDEN>
Date: Tue, 07 Feb 2012 15:10:51 -0500
From: Filipus Klutiero <chealer@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64;
	rv:8.0) Gecko/20120104 Icedove/8.0
MIME-Version: 1.0
To: bug-coreutils@HIDDEN
Subject: stat: Please add directive to display size on disk
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.186.70.17
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.4 (---)

The other day I tried figuring out how much disk space a small file 
took. I used stat, but I only realized today that stat does not provide 
that information directly, as explained by Eric Blake and Pádraig Brady 
in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10561

This information is provided indirectly by %b and %B. Multiplying the 2 
should give the size on disk. Example:

stat -c 'allocated-space=%B*%b apparent-size=%s' $file

Currently, this information can be obtained from du:

$ stat -c '%s' /etc/phpmyadmin/htpasswd.setup
54
chealer@vinci:~$ du -h /etc/phpmyadmin/htpasswd.setup
4,0K    /etc/phpmyadmin/htpasswd.setup
chealer@vinci:~$

However, it would be quite useful if stat could be used to display 
simultaneously a file's real size and size on disk.


Eric Blake suggested this directive to be %S. For the description, he 
suggested:

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

I would like to aim for clarity, as these various statistics can be 
confusing. I suggest to use the name "Size on disk". I also suggested 
the following:

Size occupied when including slack space
Size of the clusters occupied

I suggest the following synthesis:

Allocated size (space allocated on the storage device, same as %b * %B). 
This is the size of the allocated clusters, which includes slack space.




Acknowledgement sent to Filipus Klutiero <chealer@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#10755; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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