title: Comparing FilesNames only not content is my solution correct?
body: <p>we are transferring lots of docs/images and before actually saving this docs to sql server I want to compare 2 list of files.</p>
  
  <ol>
  <li><p>My List of filePaths (will be a txtFile with a list of filepaths In it.Converted to hashset)</p></li>
  <li><p>Their List of filePaths (will read on the fly and produce a hashset)</p>
  
  <pre><code>public static HashSet&lt;string&gt; ToHashSet(this string rootDirectory)
  {
      const string searchPattern = "*.*";
      string[] files = Directory.GetFiles(rootDirectory, searchPattern, SearchOption.AllDirectories);
      return new HashSet&lt;string&gt;(files);
  }
  </code></pre></li>
  </ol>
  
  <p>So I am comparing MyHashSet against TheirHashSet.</p>
  
  <p>Just getting a bit paranoid here and just want to double check if except does what I think it does.</p>
  
  <p>Except="Given 2 hashsets compare all the filePaths and if the ones in the TheirList are not found in MyList produce a result"</p>
  
  <p>I have written a small test that proves that except does find the diff.</p>
  
  <p>Is this correct and best way to compare large files?</p>
  
  <p>Dummy ProofOfConcept</p>
  
  <pre><code> class Program
  {
      static void Main(string[] args)
      {
          const string rootDirectory = @"C:\Tests";
          HashSet&lt;string&gt; myHashSet= CreateDummyHashSet(rootDirectory,10);
          HashSet&lt;string&gt; theirHashSet= CreateDummyHashSet(rootDirectory, 12);
  
          IEnumerable&lt;string&gt; result = theirHashSet.Except(myHashSet);
  
          foreach (var file in result)
          {
              Console.WriteLine(file);
          }
          Console.Read();
      }
  
      public static HashSet&lt;string&gt; CreateDummyHashSet(string rootDirectory, int numberOfFiles)
      {
          var dummyHashSet = new HashSet&lt;string&gt;();
          const string extension = ".txt";
          const string fileName = "File";
          for (int i = 0; i &lt; numberOfFiles; i++)
          {
              string fullfileName = string.Format("{0}{1}{2}", fileName, i, extension);
              string path = Path.Combine(rootDirectory, fullfileName);
              dummyHashSet.Add(path);
          }
          return dummyHashSet;
      }
  }
  </code></pre>