This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
stat (thus du) too optimistic on disk usage
- To: gnu-win32 at cygnus dot com
- Subject: stat (thus du) too optimistic on disk usage
- From: martelli at cadlab dot it (Alex Martelli)
- Date: Sun, 14 Sep 1997 18:11:50 +0100 (MET DST)
Hello,
I'm using b18 and it seems to me like stat is far too optimistic
regarding disk usage by a given file -- it seems to believe that
a small disk file may occupy just 512 or 1024 bytes of disk space,
while depending on the filesystem it could be taking up 16K or
even 32k (particularly if one has a FAT filesystem...).
Sample case: on a FAT filesystem, make a directory with 7 files
of a few bytes each and run du -k on it; it will claim 7 kB are
being taken, while in fact something like 7*16 or 7*32 might be.
The problem of too-large granularity of disk space occupation
being common in older Unix filesystems too, I would expect du
to be able to compensate for this misreporting (e.g. with a
command line switch to inform it of the actual blocksize), but
it seems to be trusting stat blindly. So maybe the stat
"syscall" should be fixed, leaving du alone?
I tried rooting around in syscalls.cc and some attempt _is_
apparent to get the "real" blocksize, but apparently it must
be failing undetectedly... any suggestion?
Alex
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".