Re: Bug#294206: stat(1) unclear about block size

2005-02-09 Thread Jeroen van Wolffelaar
On Wed, Feb 09, 2005 at 02:26:12PM -0800, Paul Eggert wrote: > Jeroen van Wolffelaar <[EMAIL PROTECTED]> writes: > > I think it's a bit betrayal to the user to just copy f_bsize if > > f_frsize is unavailable, > > There's precedent for this in lib/fsusage.c. As I understand it, it > doesn't break

Re: Bug#294206: stat(1) unclear about block size

2005-02-09 Thread Paul Eggert
[EMAIL PROTECTED] (James Youngman) writes: > findutils calls this "ST_NBLOCKSIZE" and does it this way: - That is for struct stat, no? We're talking about struct statvfs, which is a somewhat different animal. ___ Bug-coreutils mailing list Bug-coreut

Re: Bug#294206: stat(1) unclear about block size

2005-02-09 Thread Paul Eggert
Jeroen van Wolffelaar <[EMAIL PROTECTED]> writes: > I like the (latest) patch from Paul Eggert more, although I'm not sure > people will be going to understand the term "fundamental block size" > immediately. They are the name POSIX gave us; there are some advantages to sticking with the standard

Re: Bug#294206: stat(1) unclear about block size

2005-02-09 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > This introduces a new format %S to stat -f -c. > ... > Jim, this is an incompatible change to the output of "stat -f", since > it changes the default format to output both block sizes. I think the > change is useful, but if you think that's too drastic righ

Re: Bug#294206: stat(1) unclear about block size

2005-02-09 Thread James Youngman
On Tue, Feb 08, 2005 at 11:37:54PM +0100, Jeroen van Wolffelaar wrote: > If you're going to offer %S to retrieve fundamental blocksize, I think > it'd be best to actually really retrieve that value, and do something > smart otherwise (error out, noting in the documentation that %S might > not alwa

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Jeroen van Wolffelaar
On Tue, Feb 08, 2005 at 05:19:37PM -0500, Michael Stone wrote: > On Tue, Feb 08, 2005 at 01:56:00PM -0800, Paul Eggert wrote: > >OK, thanks, I installed this (revised) patch into coreutils, which I > >hope addresses that problem. > > No, if you're going to use the statvfs block size you need to pu

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Michael Stone
On Tue, Feb 08, 2005 at 01:56:00PM -0800, Paul Eggert wrote: OK, thanks, I installed this (revised) patch into coreutils, which I hope addresses that problem. No, if you're going to use the statvfs block size you need to pull the other numbers from statvfs also. IOW, just add another flag (-F?) to

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Andreas Schwab
Jeroen van Wolffelaar <[EMAIL PROTECTED]> writes: > On Tue, Feb 08, 2005 at 05:43:08PM +0100, Jim Meyering wrote: >> Does stat's --file-system (-f) option do what you want? >> >> $ stat -f / >> File: "/" >> ID: 0Namelen: 255 Type: ext2/ext3 >> Blocks: Total: 1032

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Paul Eggert
Jeroen van Wolffelaar <[EMAIL PROTECTED]> writes: > See http://bugs.debian.org/294206#msg17 for more information, bottom > line is that statvfs returns a superset of values compared to statfs, > and one of the extra values is f_frsize required for getting the free > disk space in bytes. O

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Jeroen van Wolffelaar
On Tue, Feb 08, 2005 at 05:43:08PM +0100, Jim Meyering wrote: > Does stat's --file-system (-f) option do what you want? > > $ stat -f / > File: "/" > ID: 0Namelen: 255 Type: ext2/ext3 > Blocks: Total: 1032080Free: 887328 Available: 834894 Size: > 4096

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread James Youngman
On Tue, Feb 08, 2005 at 11:22:24AM -0500, Michael Stone wrote: > On Tue, Feb 08, 2005 at 03:39:05PM +, James Youngman wrote: > >No.The POSIX standard (in a non-normative section) says :- > > > >| The unit for the st_blocks member of the stat structure is not defined > >| within IEEE Std 100

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Jim Meyering
Jeroen van Wolffelaar <[EMAIL PROTECTED]> wrote: > I've done a bit more reading and googling, and I found statvfs(2): > > struct statvfs { >unsigned long f_bsize;/* file system block size */ >unsigned long f_frsize; /* fragment size */ >fsblkcnt_

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Michael Stone
On Tue, Feb 08, 2005 at 03:39:05PM +, James Youngman wrote: No.The POSIX standard (in a non-normative section) says :- | The unit for the st_blocks member of the stat structure is not defined | within IEEE Std 1003.1-2001. In some implementations it is 512 | bytes. It may differ on a file s

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Jeroen van Wolffelaar
On Tue, Feb 08, 2005 at 03:39:05PM +, James Youngman wrote: > No.The POSIX standard (in a non-normative section) says :- > > | The unit for the st_blocks member of the stat structure is not defined > | within IEEE Std 1003.1-2001. In some implementations it is 512 > | bytes. It may differ

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Jeroen van Wolffelaar
On Tue, Feb 08, 2005 at 03:39:05PM +, James Youngman wrote: > On Tue, Feb 08, 2005 at 02:42:09PM +0100, Jeroen van Wolffelaar wrote: > > Package: coreutils > > Version: 5.2.1-2 > > > > %s Optimal transfer block size > > $ > > > > 'Optimal transfer block size', I have the suspection that %

Re: Bug#294206: stat(1) unclear about block size

2005-02-08 Thread James Youngman
On Tue, Feb 08, 2005 at 02:42:09PM +0100, Jeroen van Wolffelaar wrote: > Package: coreutils > Version: 5.2.1-2 > > %s Optimal transfer block size > $ > > 'Optimal transfer block size', I have the suspection that %s IS the > blocksize of the filesystem, which should be used in a number of othe

Bug#294206: stat(1) unclear about block size

2005-02-08 Thread Jeroen van Wolffelaar
Package: coreutils Version: 5.2.1-2 I'm looking into using stat for determining available diskspace, however, this proves difficult or badly documented. $ stat --help (...) Valid format sequences for file systems: %a Free blocks available to non-superuser (...) %s Optimal transfer block s