Subject: Re: du(1) with gigabyte option.
To: None <tech-userlevel@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 02/21/2003 00:31:48
> It would be nice if du and friends would report decimal values
> instead of power-of-two approximations.  "kilobyte" has a fixed
> meaning: 1000 bytes.

You can keep claiming that till you're blue in the face and it won't be
any more true.  As long as computers are binary, powers of two will be
with us.  "Kilobyte"'s meaning has drifted from the original simple
meaning of the SI prefix "kilo-" applied to "byte", and I doubt you'll
be able to haul it back.

Disk manufacturers like to pretend it's true, because it would mean the
numbers for their disk capacities sound larger; recently, they've taken
to putting footnotes in their ads indicating that they're using metric
gigabytes, which to me is an outright admission that they know they're
being deceptive, and that they're doing it deliberately - I don't quite
understand why they haven't been taken to task for deceptive
advertising.  Memory manufacturers, at least, get it right; you don't
see 268.435456MB memory modules advertised....

> ls(1) shows bytes, although I can't reconcile -s with -l:

> $ ls -ls /netbsd
> 9232 -rwxr-xr-x  1 root  wheel  4749749 Nov 19  2000 /netbsd
> $ expr 512 \* 9232 - 4749749
> -22965

Holes.  Presumably whatever created /netbsd was something that created
holes where possible, and you're on a port where the bootblocks are
willing to boot a kernel with holes (at least some <port,version> pairs
aren't).

The calculation you did could also give a largeish positive number,
from indirect blocks.  (The st_blocks figure, which drives -s, includes
indirect blocks, while the st_size figure, which drives -l, does not.)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B