On Tue, Feb 08, 2005 at 03:39:05PM +0000, 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 system basis. There is no correlation > | between values of the st_blocks and st_blksize, and the f_bsize (from > | <sys/statvfs.h>) structure members. > | > | Traditionally, some implementations defined the multiplier for > | st_blocks in <sys/param.h> as the symbol DEV_BSIZE. > > I think almost all systems use 512 byte units.
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_t f_blocks; /* size of fs in f_frsize units */ fsblkcnt_t f_bfree; /* # free blocks */ fsblkcnt_t f_bavail; /* # free blocks for non-root */ (...) and a note in statfs(2): LSB has deprecated the library calls [f]statfs() and tells us to use [f]statvfs() instead. So, since statfs seems deprecated, and statvfs more informative (it actually carries the units in which free and total size of filesystems is written), I think it would be useful for stat to support statvfs, which provides a superset of the functionality of statfs(2). Thanks, --Jeroen -- Jeroen van Wolffelaar [EMAIL PROTECTED] (also for Jabber & MSN; ICQ: 33944357) http://Jeroen.A-Eskwadraat.nl -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]