bug-coreutils
[Top][All Lists]
Advanced

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

Re: PATCH: df -mP alignment fix and -c --total option added to df


From: Jim Meyering
Subject: Re: PATCH: df -mP alignment fix and -c --total option added to df
Date: Sat, 15 Nov 2003 07:59:24 +0100

Dennis Smit <address@hidden> wrote:
> I had a glance at the TODO list and saw that df -mP had an alignment bug
> so i fixed that. Also i saw that an --total option was requested so
> did that as well.

Thanks for the patches.

Fixing the -mP alignment problem is not so simple.
With your patch, `df -P' output is then misaligned.
  $ ./df -P
  Filesystem         1024-blocks   Used Available Capacity Mounted on
  /dev/hda6              4128320   3516756    401828      90% /

If you propose a new patch for that problem,
please send it separately from any other changes.

> I hope i did it alright, if not please make me know so that i can
> improve my work. Also i would like to do some more work on df or
> possibly other things.

> ChangeLog:
>         * src/df.c (print_header): fixt alignment for `df -mP'.
>         (main): added support for -c --total.
>         (show_grand_total): added function to show the grand total.
>         (show_information): added function splitted this from show_dev
>         so the grand_total can use the same entry displaying function.
>         (convert_blocksize): added function that converts the blocksize
>         for the grandtotal so that only the same blocksize amounts are
>         added to each other. Is this function right ? (took from
>         human_readable).
>         (show_dev): splitted out the show_information part and added
>         support for grand total option.

Shouldn't the totals be represented internally as byte counts?
Your patch converts intermediate results to output units, which
would suffer unnecessary errors.

Also, please don't make unnecessary changes like this:

> -    disk = "-";                      /* unknown */
> +    disk = "-";                 /* unknown */




reply via email to

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