bug#47085: du: why does 'usage' show prefixes 'Z' or 'Y' if they are disallowed?

2021-03-12 Thread Glenn Golden
Paul Eggert  [2021-03-12 11:46:52 -0800]:
> On 3/11/21 8:53 PM, L A Walsh wrote:
> > Why are those suffixes listed as valid under the program 'usage'
> > and manpage, when they are automatically disallowed?
> 
> They are valid if your computer has wide-enough integers. As far as I know
> no platform supports Y and only one or two supports Z, but the documentation
> is future-proofing.
> 
> Conversely, if you're running on a really small computer that doesn't even
> support 64-bit integers, even 'T' is too wide.
> 
> I doubt whether it's worth complicating the manual for this minor detail, as
> the current diagnostic "'Y" too large" is accurate as far as it goes.
> 

The manual actually does address this briefly:

coreutils.info 8.32, Section 2.3:

   "Large sizes like ‘1Y’ may be rejected by your computer due to
limitations of its arithmetic."







bug#47085: du: why does 'usage' show prefixes 'Z' or 'Y' if they are disallowed?

2021-03-12 Thread Paul Eggert

On 3/11/21 8:53 PM, L A Walsh wrote:

Why are those suffixes listed as valid under the program 'usage'
and manpage, when they are automatically disallowed?


They are valid if your computer has wide-enough integers. As far as I 
know no platform supports Y and only one or two supports Z, but the 
documentation is future-proofing.


Conversely, if you're running on a really small computer that doesn't 
even support 64-bit integers, even 'T' is too wide.


I doubt whether it's worth complicating the manual for this minor 
detail, as the current diagnostic "'Y" too large" is accurate as far as 
it goes.






bug#47103: numfmt: invalid suffix 'k'

2021-03-12 Thread Daniel Callejas Sevilla
Hello,

the SI prefix for 'a thousand' is a lowercase k and not an uppercase K [1].

The default behavior of numfmt with '--from=si' option is therefore
contrary to expectation:

$ numfmt --from=si
 500k# Should be accepted as valid SI
 numfmt: invalid suffix in input: ‘500k’

$ numfmt --from=si
 500K# Should result in error, 'K' stands for kelvin unit.
 50

$ numfmt --version
 numfmt (GNU coreutils) 8.26
 Packaged by Cygwin (8.26-2)
 Copyright (C) 2016 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later .
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.

 Written by Assaf Gordon.


Best regards,
Daniel.

[1] Page 143 of https://www.bipm.org/en/publications/si-brochure/





bug#47085: du: why does 'usage' show prefixes 'Z' or 'Y' if they are disallowed?

2021-03-12 Thread Glenn Golden
On Thu, Mar 11, 2021, at 21:53, L A Walsh wrote:
>
> Also something I didn't see as being clear:
>   I don't see where it says it will always round up to next higher
>   unit (it may say it somewhere, I just don't see it and was
>   surprised to see 'du -BT /tmp|hsort -s' show all objects as
>   being 1.0T and for hsort to show a summary of ~148T
>   (hsort sorts by human prefixes and has an optional '-s'
>   switch that shows an additive sum of the sizes).
> 

See coreutils.info Section 14.2 (entitled "du: Estimate file space  usage",
second paragraph), and coreutils.info Section 2.3  (entitled "Block size",
first paragraph).  Both state that fractional block sizes are rounded up
to the nearest integer.