Computing.Net > Forums > Windows 95/98 > Size vs Size on disk

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Size vs Size on disk

Reply to Message Icon

Name: Miskva
Date: July 26, 2002 at 05:42:00 Pacific
Comment:

Hi,
I am currently trying to set up a program concerning directory sizes, and I found somethin peculiar: in windows explorer, when you right click (properties) and look at the size of a directory (and its subdirs) .. you have two sizes : 'Size' and 'Size on disk'

It wouldn't be a problem, if those figures would be the same, but they are not always just that. It appears in dirs with may subdirs apparently, and probably this is the cause of fragmentation.

Question is: which one is the real size, given the fact I am only interested in the total number of bytes by all files togheter ? Why is there a difference ? Does a directory also have a 'size' ?

I have seen differences of 4 megabyte on 180 megabyte, so it's not a small diff.



Sponsored Link
Ads by Google

Response Number 1
Name: Steve
Date: July 26, 2002 at 06:17:03 Pacific
Reply:

Data is allocated on a disk in arbitrarty blocks not byte by byte. On a FAT32 file system (most common one), data is allocated in chunks of 4096 bytes (4Kb). When a file is stored onto these allocation units, either a whole unit is taken up or nothing, You cannot use half an allocaion unit. As a result, if the size of a particular file is not a multiple of 4096 bytes, there is some space wasted (e.g. a 4097 byte file will take up 8192 bytes on your disk because it will need to take up a whole new allocation unit to store just that extra byte). The "size on disk" is the total amount of space allocated to the data on your hard disk (including wasted space), while "size" means simply how much data is stored. You will note that if you have the FAT32 file system, the "size on disk" will always be a multiple of 4096 bytes.


0

Response Number 2
Name: WhiPhil
Date: July 26, 2002 at 06:39:56 Pacific
Reply:

Steve's explanation is correct, except that the "allocation unit" is based on the size of the particular disk partition.
Up to 8GB, the size is 4K.
8-16 it is 8K
16-32 it is 16K
and over 32 it is 32K

where 1K=1024 bytes


0

Response Number 3
Name: Miskva
Date: July 26, 2002 at 06:55:48 Pacific
Reply:

OK, that explains a lot already !

Next step would be, assume I am copying these files to a cd-rom, and I know from advance exactly how much space I got on the disc ...

Which size must I refer to from source ? Does a cd-rom also use the same storage technique ? Or do they just write files and nothing else ?


0

Response Number 4
Name: larry
Date: July 26, 2002 at 11:49:12 Pacific
Reply:

Cdroms use an entirely different system and the 'size' comes closest. Your burner program should give you a good approximation but I have learned from experience to always leave a little margin for error.


0

Response Number 5
Name: Frenchie
Date: July 26, 2002 at 14:41:22 Pacific
Reply:

Hi all,

My 2 cents: the name of the "chunk" is cluster (the storage unit on a disk).

Have a look at the Dos command CHKDSK and you'll see the size of the cluster on your disk.

Below is the explanation:
You know about the FAT = File Allocation Table which is an index in which you've a record to describe each cluster.

FAT16 (old FAT system) was coded on 16 bits
ie there were 2**16 = 65,536 possible clusters in a partition and the size of a cluster was Total-size/65536 so that a 2 GB disk had a 32 KB cluster (a little 10 Byte file was in fact 32,000 bytes!)

You understand the most space on a disk!
You understand why we tended to partition large disks!
You understand why we welcomed FAT32 (addresses were coded on 32 bits hence a possible 2**32 number of clusters on a partition).
NB: Drive Space and other such programs are storing several files in a cluster).

Gérard from Paris, France


0

Related Posts

See More



Response Number 6
Name: drm
Date: July 26, 2002 at 19:32:07 Pacific
Reply:

CDs do not use the FAT system and the size on disk is approximately the same as the size of the file(s).


0

Sponsored Link
Ads by Google
Reply to Message Icon

Login without logon troubleshoot zip drive



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 95/98 Forum Home


Sponsored links

Ads by Google


Results for: Size vs Size on disk

win95 on disks www.computing.net/answers/windows-95/win95-on-disks/5480.html

win95 setup on disks www.computing.net/answers/windows-95/win95-setup-on-disks/73199.html

* New DELTA2: Delete index.dat @(re)boot www.computing.net/answers/windows-95/-new-delta2-delete-indexdat-reboot/116722.html