public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* stat (thus du) too optimistic on disk usage
@ 1997-09-14  9:09 Alex Martelli
  0 siblings, 0 replies; only message in thread
From: Alex Martelli @ 1997-09-14  9:09 UTC (permalink / raw)
  To: gnu-win32

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".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-09-14  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-14  9:09 stat (thus du) too optimistic on disk usage Alex Martelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).