title: Finding all files in a folder using enumeration
body: <p>I'm trying to list out all files under a given directory by taking sub directories as well into account.I'm using yield so that I could club this with Take where I call this (note that I'm using .NET 3.5).</p>
  
  <p>Below is my code:</p>
  
  <pre><code>IEnumerable&lt;string&gt; Search(string sDir)
  {
         foreach (var file in Directory.GetFiles(sDir))
         {
              yield return file;                
         }
  
         foreach (var directory in Directory.GetDirectories(sDir))
         {
                  Search(directory);                
         }
  }
  </code></pre>
  
  <p>I don't know what is going wrong here, but it only returns one file (which is the one under the root directory, and there is only one there as well). Can you please help?</p>