Feature #7967
closedWant apparent size option for du(1)
100%
Description
Traditionally, du(1)
computes a file's size by recording its stat.st_blocks
value as returned by fstat()
. In the end, these values are tallied for the list of files du
operated against and multiplied by a static block size (512 byes) to compute how much space, in blocks, the file consumes.
In today's world of compressed file systems, sparse files, so-on, du(1)
could offer information regarding the "apparent" size of a given file, as the file size that the user understands it to be might be larger than the number of on-disk blocks it physically occupies. This may be done by using stat.st_size
instead, as what ls
does.
Other implementations of du
address this issue. GNU Coreutils' du
offers the --apparent-size
long opt, and FreeBSD's du
does the same albeit with a decidedly less-cumbersome -A
option. It is the submitter's opinion that -A
is fine for use in the illumos arena as it is currently not claimed by any du
option.
Updated by Dale Ghent about 5 years ago
WIP webrev: https://daleghent.com/webrevs/7967/
Updated by Electric Monk about 5 years ago
- Status changed from New to Closed
git commit 8aaea06ac924e217626f879f326b781e9780f7d7
commit 8aaea06ac924e217626f879f326b781e9780f7d7 Author: Dale Ghent <daleg@omniti.com> Date: 2017-03-15T19:31:16.000Z 7967 Want apparent size option for du(1) Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Peter Tribble <peter.tribble@gmail.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Richard Lowe <richlowe@richlowe.net>