coreutils
[Top][All Lists]
Advanced

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

Re: df: --inodes versus --portability mode


From: Pádraig Brady
Subject: Re: df: --inodes versus --portability mode
Date: Thu, 20 Sep 2012 02:08:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

On 09/18/2012 11:54 AM, Bernhard Voelker wrote:
On 09/18/2012 12:04 PM, Pádraig Brady wrote:
On 09/18/2012 10:47 AM, Bernhard Voelker wrote:
For the implementation of the new --output option, and the cleanup
necessarily coming with it, I'd like to fix that so that a -P will
override a previous -i and vice versa:

    $ src/df -iP | head -n 2
    src/df: warning: option '-P' is overriding the previous mode
    Filesystem     1024-blocks      Used Available Capacity Mounted on
    rootfs            12095032   7515424   3965208      66% /

    $ src/df -Pi | head -n 2
    src/df: warning: option '-i' is overriding the previous mode
    Filesystem       Inodes   IUsed    IFree IUse% Mounted on
    rootfs           768544  237523   531021   31% /

WDYT?

I don't like order being significant.

Good point.

du -i is an extension to POSIX, so I think it's fine for -i to override.

s/du/df/ i guess ;-)

-P essentially meant don't wrap but that's moot now,

That was actually my question: -P means "default mode" in
the first place, i.e. one could read it as "print block size".
And now comes -i ...

but I'd keep it as is for backwards compat.

... another good point - and I think I should stick with it.
So as -P does nothing, shouldn't df print a warning that
it disregards it when -i is in effect?

Well as it used to do something (ensure single lines)
so I was going to suggest not printing a warning,
for a while at least.  Though I now notice that BSD also
implements -i, and that adds the inodes columns _in addition_
to the blocks columns. So it's more likely that users
may be confused about this combination, so I guess a warning
is warranted. Note we couldn't change to the BSD -i behavior
for backward compat reasons.

I thought that I could get rid of the mashing up of the scale
factor (human_output_opts, output_block_size) and df's main
modes DEFAULT_MODE, INODES_MODE, POSIX_MODE and HUMAN_MODE)
somehow ... because the same question will arise again with
'df -P --out=...' ;-/
IMHO the cleanest solution would be to make the main modes
-i, -p and the new --o mutually exclusive.

Yes --o should be mutually exclusive with the -i and -P options.

cheers,
Pádraig.



reply via email to

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