Subject: FW: reported vs actual file sizes
From: Dennis McCunney <[email-masked]>
To: "Cygwin Mailing list (E-mail)" <[email-masked]>
Date: Fri, 25 Jun 1999 14:39:54 -0400

> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]]
> Sent: Friday, June 25, 1999 1:48 PM
> To: [email-masked]
> Cc: [email-masked]
> Subject: reported vs actual file sizes
> 
> After installing cygwinb20.1 on a few machines, there's been 
> some troubling observations made.  Hopefully someone on this 
> mailing list can answer the questions.

...

> On NT SP4 with a FAT (32??) filesystem, all the cygwin-b20.1 binaries,
> ...\cygwin-b20\H-i586-cygwin\bin\*.exe, have "used" file 
> sizes that are multiples of 32,768 bytes.  This seems very 
> unreasonable, especially in the case of:
> 
>         true.exe
>         Size:	395 bytes (395 bytes), 32,768 bytes used
>                 ^^^^^^^^^usual^^^^^^^  ^^^^^^used^^^^^^^
> 
> On Win98 with FAT32 filesystem, the "used" sizes seem to be 
> multiples of 4096bytes.
> 
> The Windows binaries, explorer.exe, doesn't seem to have this problem.
> 
> So, the question is:
> Is this a problem w/ my configuration of Window98/NT or is there
> something wrong with the file/io stuff within cygwinb20.1?

This may not be a problem at all, though I do wonder about the the used 
sizes reported under NT.  It isn't a Cygwin issue.

The "usual" size is the actual number of bytes in the file.  The "used" 
size represents the amount of disk space required to hold it.

The smallest amount of disk DOS/Windows I/O routines can deal with
is a cluster.  How big a cluster is depends upon the version of DOS
and the size of the drive.  Older versions of DOS, up to DOS 6.22/Win 3.X
used a FAT16 file system which could handle a maximum of 65536 clusters
on a logical drive, and couldn't handle drives larger than 2GB.  Win9X 
uses a FAT32 files system, and NT uses either FAT16 or NTFS, depending 
on how it was installed.  (NT through 4.0 does not grok Fat32.  NT 5.0 
is supposed to be able to.)  These can use smaller clusters for more
efficient storage.

A 4K cluster is reasonable for Win9X/Fat32 for a large hard drive.  It 
means that each file will occupy a minimum of 4K of disk space, even if 
the file itself is only one byte.  DOS/Windows can't deal with smaller
disk allocations than that.

A 32K cluster size for NT sounds like it was installed on a FAT16 volume.
FAT16 is extremely innefficient at space allocations, and has large
amounts of wasted space, especially at larger cluster sizes.  Unless 
there is some good reason why the NT volume has to be FAT16 (like other 
things besides NT will have to be able to read it), you would be better
of converting the volume to NTFS.  NTFS uses a 512 byte cluster size, 
among other improvements.

Bottom line, however, hard drives are _cheap_, with disk space at 50
cents a megabyte or below (probably below), so wasted space my not be
cost effective to address.

> -Paul

_______________
Dennis McCunney

--
Want to unsubscribe from this list?
Send a message to [email-masked]