Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What you are asking may not be possible because of how the file-system store it's data.</p> <h2>It is a file system limitation</h2> <p>There is <strong>no way</strong> to know the <strong>total size of a folder</strong>, nor the <strong>total files count</strong> inside a folder without enumerating files <strong>one by one</strong>. Neither of these informations are stored in the file system.</p> <p>This is why Windows shows a message like <code>"Calculating space"</code> before copying folders with a lot of files... it is actually counting how many files are there inside the folder, and summing their sizes so that it can show the progress bar while doing the real copy operation. (it also uses the informations to know if the destination has enough space to hold all the data being copied).</p> <p>Also when you right-click a folder, and go to properties, note that it takes some time to count all files and to sum all the file sizes. That is caused by the same limitation.</p> <p>To know how large a folder is, or how many files are there inside a folder, you must enumerate the files one-by-one.</p> <h2>Fast files enumeration</h2> <p>Of course, as you already know, there are a lot of ways of doing the enumeration itself... but none will be instantaneous. You could try using the <a href="http://en.wikipedia.org/wiki/NTFS#USN_Journal" rel="nofollow">USN Journal</a> of the file system to do the scan. Take a look at this project in CodePlex: <a href="http://mftscanner.codeplex.com/" rel="nofollow">MFT Scanner in VB.NET</a> (<em>the code is actually in C#... don't know why the author says it is VB.NET</em>) ... it found all the files in my IDE SATA (not SSD) drive in less than 15 seconds, and found 311000 files.</p> <p>You will have to filter the files by path, so that only the files inside the path you are looking are returned. But that is the easy part of the job!</p> <p><em>Hope this helps in your project... good luck!</em></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload