title: Find Particular File Types
body: <p>I've encountered an peculiar issue when utilizing <code>System.IO</code>.  When you iterate through a directory for a file with a type of <code>File</code>, without an extension, the file isn't detected.</p>
  
  <pre><code>// Successful:
  var files = DirectoryInfo(server.Path).GetFiles("sitemap*.*);
  var contents = Directory.GetFiles(server.Path, "sitemap*.*", ...);
  </code></pre>
  
  <p>The above code would suffice in most instances, however if you have other types with identical name, they'll be collected as well.  </p>
  
  <p>Our issue is encountered when you only want the <code>sitemap.file</code>.  </p>
  
  <pre><code>// Invalid Code:
  var files = DirectoryInfo(server.Path).GetFiles("sitemap*.file);
  var contents = Directory.GetFiles(server.Path, "sitemap*.file", ...);
  var examples = DirectoryInfo(server.Path).GetFiles("sitemap*);
  </code></pre>
  
  <p>The array is empty, it doesn't find any of the raw <code>.file</code> extension files.  I'm assuming the issue occurs because it doesn't actually have an extension.</p>
  
  <p>How do you circumvent this limitation?</p>
  
  <p><strong>Update:</strong>  I know I could do something along these lines with <code>FileInfo[]</code>, but was hoping to find a more simple approach then iteration, then compare with:</p>
  
  <pre><code>var files = DirectoryInfo(server.Path).GetFiles("sitemap*.*);
  foreach(var file in files)
       if(file.Extension != ".gz" &amp;&amp; file.Extension != ".xml")
       {
            // Do something with File.
       }
  </code></pre>
  
  <p>Especially if you have a wide assortment of extensions within your directory. You would think it would account for such a type, or lack there of.</p>
  
  <p><img src="https://i.stack.imgur.com/RExYB.png" alt="Multiple">
  <img src="https://i.stack.imgur.com/BdrkP.png" alt="Empty Array"></p>