[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: |
Tue, 18 Sep 2012 11:04:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
On 09/18/2012 10:47 AM, Bernhard Voelker wrote:
According to the info pages, the -P mode is like the default mode:
`-P'
`--portability'
Use the POSIX output format. This is like the default format
except for the following:
1. The information about each file system is always printed on
exactly one line; a mount device is never put on a line by
itself. This means that if the mount device name is more
than 20 characters long (e.g., for some network mounts), the
columns are misaligned.
That should be updated. We no longer split to multiple lines
(though you could leave that assertion).
We should remove the mention about misaligned cols which is no longer the case
2. The labels in the header output line are changed to conform
to POSIX.
3. The default block size and output format are unaffected by the
`DF_BLOCK_SIZE', `BLOCK_SIZE' and `BLOCKSIZE' environment
variables. However, the default block size is still affected
by `POSIXLY_CORRECT': it is 512 if `POSIXLY_CORRECT' is set,
1024 otherwise. *Note Block size::.
BTW: I don't see in the code why df would split an entry on several lines.
Yep I removed that.
To my question:
Reading the above, I would assume that -P would override a previous
-i (or be mutually exclusive to that), but it doesn't:
$ df -iP | head -n 2
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs 768544 237523 531021 31% /
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.
du -i is an extension to POSIX, so I think it's fine for -i to override.
-P essentially meant don't wrap but that's moot now,
but I'd keep it as is for backwards compat.
thanks,
Pádraig.