0

In Windows, when I access a folder's properties in order to asses how large it is, I have to wait while it sums up its size, and I can watch its size in MB grow while doing so. This process can take up long amounts of time.

However, when I check my disk properties (ie C:), the filesize is instantly displayed with no delay.

Why does this happen?

BTW, I'm on an SSD with read times well over 2GB/s so that shouldn't be the issue.

2
  • See this:: superuser.com/q/837016
    – Biswapriyo
    Commented Jun 26, 2017 at 16:06
  • Thanks @Biswa but that's not my question : It's not a problem to me, I'd just like to understand Commented Jun 26, 2017 at 16:40

1 Answer 1

1

When you look at the properties of a folder, it needs to iterate through all the sub-folders and files, reading the properties (name, size, etc) of everything. That requires a lot of calls to read data from the disk.

When you look at the properties of the disk, it simply needs to look at the bitmap over free/used space and calculate how much there is of each.

Note that this a quite simplified explanation, and it depends on the file system used how the data is stored.

3
  • +1: This is a very good answer that is straight forward and to the point. I started writing an answer about how a file can be marked sparse, or you don't have permissions to read the file, etc...
    – surfasb
    Commented Jun 26, 2017 at 17:59
  • @surfasb if you have the time, I would really appreciate that complex answer. This one is correct and concise, but if you can tell me more, I'd love to hear it. Commented Jun 27, 2017 at 11:25
  • The simplest way is probably to read through the Ext4 specification. This page explains a lot: ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout. The pricipals are similar for most other filesystems.
    – Magnus
    Commented Jun 28, 2017 at 12:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .