title: How to tell when a recursive method is finished
body: <p>While trying to complete a duplicate file software I noticed there was an issue with the Directory.GetDirectories() method. When the folder was not accessible for whatever reason (most of the time it was due to the folder being a system folder) the loop would stop since an exception would be thrown.</p>
  
  <p>After some research trying to figure out what would be the best method to do the recursion manually I found <a href="https://stackoverflow.com/questions/172544/ignore-folders-files-when-directory-getfiles-is-denied-access">Marc Gravell's example</a> which worked perfectly for my needs.</p>
  
  <p>My issue with the above method is that I can't figure out how it will be possible to know when the recursion method has finished processing any files/folders. So any insights on the matter would be appreciated.</p>
  
  <p>Thanks in advance.</p>