bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: do you use du --bytes (-b) [Re: 'du -b' bug in fileutils-4.1


From: Paul Eggert
Subject: Re: RFC: do you use du --bytes (-b) [Re: 'du -b' bug in fileutils-4.1
Date: 20 Feb 2003 17:08:27 -0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3

Jim Meyering <address@hidden> writes:

>  1) Accumulate counts of bytes, rather than counts of blocks
>     so that `du --bytes' works like it did back in fileutils-3.16.
>     Would anyone mind being limited to totals < 2^64 bytes?  :-) 1/2
> 
>  2) Leave the code the way it is and document clearly
>     that --bytes (-b) is equivalent to --block-size=1
> 
>  3) Like 1), but make the printing of individual byte counts
>     dependent on a new option.

fileutils 3.16's -b option had two effects.  First, it printed sizes
in bytes; second, it accumulated apparent sizes (namely, st_size)
rather than actual disk usage (namely, st_blocks * 512 in the typical
case).  In retrospect it would have been better to decouple these
notions.

How about having a new option (--apparent-size, say) that causes "du"
to accumulate apparent sizes instead of disk usage?  That would be
more orthogonal.  We could then change "du -b" so that it is
equivalent to "du --apparent-size -B 1"; this would restore the
fileutils 3.16 behavior.  It seems to me that this would be more
useful than the current behavior, where "du -b" is merely short for
"du -B 1", as that is not much of an abbreviation.

If we do this, the documentation should mention that the apparent size
can be either more or less than the actual disk usage, due to holes in
files, internal fragmentation, indirect blocks, and the like.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]