bug-coreutils
[Top][All Lists]
Advanced

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

Re: sort human readable suffixes


From: Paul Eggert
Subject: Re: sort human readable suffixes
Date: Sun, 30 May 2004 01:24:16 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Cornelis de Gier <address@hidden> writes:

>> Beware the decimal-point character: it's locale-dependent.
>
> strtod can take care of that

But strtod is way overkill, and it introduces errors and is slower.
Wouldn't it be better to use the -n option as a model?  (Or perhaps
combine with either -n or -g.)

>> Handle both decimal and binary powers of 2, by looking for suffixes
>> like "GB" (decimal) versus "G" not immediately followed by "B"
>> (binary).
>
> df, du and ls don't add a B in their human readable output.

True.  I guess we'll need to add an option to sort base-1000 (e.g., df
--si) versus base-1024 (e.g., df --human).  Too bad.

> The E doesn't create a problem in this example:...
> Does it give problems in other situations?

Sure: e.g., "0xEE" is ambiguous (assuming C99 strtod, which parses
hexadecimals).  But perhaps we can say we don't support that....




reply via email to

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