How Much Space Do Empty Files Consume?

12

2

Windows reports both, empty files and folders, as taking up 0 bytes. Surely it takes something to store the file name, attributes, date [created/modified/accessed] etc.

How is this weighted?

Gary

Posted 2012-10-02T02:20:56.287

Reputation: 646

Related: How are filenames stored?

– Ƭᴇcʜιᴇ007 – 2015-08-21T20:53:09.510

I see you tagged this as [fat32] as well... Are you looking for information on both then? – Canadian Luke – 2012-10-02T03:09:51.743

Wasn't sure how much of a difference it would make. I'm not as interested in how the data is stored as I am how to calculate the size of the metadata. Hopefully I'll have that solved after reading Karan's links. – Gary – 2012-10-02T04:24:07.533

Answers

11

From an MS article titled Optimizing NTFS:

All NT disk file systems, including NTFS, use the cluster as their basic unit of storage. Regardless of how small a file is, it must take up at least one cluster of disk space. Thus, very small files that are smaller than a cluster waste disk space. (Files that are less than 1KB are an exception. The system stores these files within the MFT File Record Segment—FRS—that refers to them, instead of storing them externally.) In addition, when a file doesn't end on an even cluster boundary, the file's spillover takes up another full cluster, wasting space. The larger the cluster that the file spilled over to, the more space is wasted.

The italicised portion tells you why empty files are reported as taking up no disk space (the space taken up by the file table entry is not included in the calculations).

Edit: Another useful article detailing the exact process followed.

Karan

Posted 2012-10-02T02:20:56.287

Reputation: 51 857

The PC Guide link is dead – mlhDev – 2019-10-22T16:27:10.987

Link fixed. Pointing to WayBack Machine version. – EnE_ – 2019-11-06T01:59:47.103