bug-coreutils
[Top][All Lists]
Advanced

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

bug#9279: df -h should use human_round_to_nearest in human_output_opts f


From: Jim Meyering
Subject: bug#9279: df -h should use human_round_to_nearest in human_output_opts for more accurate results
Date: Thu, 11 Aug 2011 17:50:08 +0200

Paul Eggert wrote:
> Thanks, but df always rounds up.  POSIX requires this for formats it 
> specifies;
> see <http://pubs.opengroup.org/onlinepubs/9699919799/utilities/df.html>
> and look for "rounded".  for other formats, I thought it better to be
> consistent.

Thanks for the patch.
Note that the consistency argument applies not just to df, but also to
du and ls.  All of those tools are documented to round block counts up.

If you feel ambitious, an alternative may be to extend human.c so that
setting the BLOCK_SIZE envvar to say, "human-readable-round-to-nearest",
makes all of those tools do what you propose.  The "Block size" section
of "info coreutils" describes how the BLOCK_SIZE envvar works.

I'm closing this issue.
If you propose to change gnulib's human.c,
please start a new thread with an appropriate subject.





reply via email to

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