small usr.bin/find patch

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed Jun 24 10:31:41 UTC 2009


Alexander Best wrote:
> hmmm...but dd e.g. uses lowercase instead of upercase letters to indicate
> kilobyte, megabyte and so on. isn't there some unix/posix/whatever standard
> telling app developers what to use?

Sure. The standard for scale-prefixes is defined by the Systeme
Internationale as part of the definition of SI units:

  http://www.npl.co.uk/reference/measurement-units/si-prefixes/

Note that these are strictly powers-of-10^3 multipliers, and explicitly
not the computing style powers-of-2^10 commonly used for file sizes or
hard drive capacities, which should instead use the somewhat clunky Ki,
Mi, Gi etc. forms:

  http://physics.nist.gov/cuu/Units/binary.html

These binary prefixes are mandated by the IEC and approved by the IEEE
amongst others.

Not that many people use the binary prefixes appropriately, relying on
context to disambiguate 1 MB = 1024 KB = 1,048,576 Bytes etc.  Except
that (confusingly) as a measure of network bandwidth 10 Mb/s always was
10,000,000 b/s and never 10,485,760 b/s; a fact that has caught me out
more than a few times.

Making find(1) / dd(1) / etc. operate pedantically correctly with these
scale-factor symbols would cause a certain degree of pain for little
practical gain.  Unless there was a broad consensus amongst all Unixoid
OS providers, I can't see that change ever happening.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       Flat 3
                                                      7 Priory Courtyard
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
                                                      Kent, CT11 9PW, UK

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20090624/d8ff626a/signature.pgp


More information about the freebsd-hackers mailing list