title: Show progress when searching all files in a directory
body: <p>I previously asked the question <a href="https://stackoverflow.com/questions/6061957/get-all-files-and-directories-in-specific-path-fast">Get all files and directories in specific path fast</a> in order to find files as fastest as possible. I am using that solution in order to find the file names that match a regular expression.</p>
  
  <p>I was hoping to show a progress bar because with some really large and slow hard drives it still takes about 1 minute to execute. That solution I posted on the other link does not enable me to know how many more files are missing to be traversed in order for me to show a progress bar.</p>
  
  <p><strong>One solution that I was thinking about doing was trying to obtain the size of the directory</strong> that I was planing traversing. For example when I right click on the folder <code>C:\Users</code> I am able to get an estimate of how big that directory is. If I am able to know the size then I will be able to show the progress by adding the size of every file that I find. In other words the progress = (current sum of file sizes) / directory size</p>
  
  <p>For some reason I have not been able to efficiently get the size of that directory. </p>
  
  <p>Some of the questions on stack overflow use the following approach:</p>
  
  <p><img src="https://i.stack.imgur.com/D36Xf.png" alt="enter image description here"></p>
  
  <p>But note that I get an exception and are not able to enumerate the files. I am curios in trying that method on my c drive.</p>
  
  <p>On that picture I was trying to count the number of files in order to show a progress. <strong>I will probably not going to be able to get the number of files efficiently using that approach</strong>. I where just trying some of the answers on stack overflow when people asked <code>how to get the number of files on a directory</code> and also people asked <code>how the get the size f a directory</code>. </p>