Windows – Whats the actual file size

filesystemswindows xp

In Windows XP, under File Properties, what is the actual file size? Size or Size-on-disk?

I'm looking for the exact size of the file, in bytes. Why does Windows blame the use of extra space on the disk, instead of calling it Size Windows takes to store this file?

Best Answer

I don't beleive this is a windows specific issue. Because disks are allocated in blocks, the file will potentially take up more space on disk than it's actual size if the file size is not an exact mulitple of the disks block size.

Consider:

File         |------3.4k------|   |-------------4.1k--------| 
Disk Blocks  |--------4k----------|--------4k----------|--------4k----------|

Files on disk must be aligned to the allocated blocks (they must start where a block starts) so for example, if a files actual size was 3.4k, and disk block size was 4k, the files size on disk would be 4k because even though there are only 3.4k of data in the file, it effectively is taking up 4k on the disk because you can't use the remainder of that block for anything.

Related Question