May 3rd, 2012

How does Explorer calculate the folder size information in the folder tooltip?

This information is accurate as of Windows 7; the algorithm may change for future versions of Windows. The information is being provided for the edification of computer network administrators, who are curious about random stuff like this since it can affect their network load. When you hover over a folder, Explorer shows an infotip (a special type of tooltip) which contains information about the directory, and the information that concerns network administrators is the “Size”. How does Explorer calculate the size? Explorer calculates the size by performing a naïve recursive listing of the directory and adding up the sizes of all the files it finds. If the enumeration takes longer than three seconds, then Explorer gives up after three seconds and reports the size as “larger than X” where X was the size it managed to calculate so far.

If you don’t want Explorer to do this calculation, you can disable it from the Folder Options control panel by unchecking the box labeled Display file size information in folder tips.

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.