title: How to tell whether a file system object is a path or a directory
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/439447/net-how-to-check-if-path-is-a-file-and-not-a-directory">.NET How to check if path is a file and not a directory?</a>  </p>
  </blockquote>
  
  <p>Can anyone think of a good way of telling whether a file system object path equates to a a file or a directory?</p>
  
  <p>I did have the following method:</p>
  
  <pre><code>public static bool PathIsFile(this string fullPath)
  {
      return (Path.GetExtension(fullPath).Length &gt; 0);
  }
  </code></pre>
  
  <p>But some files have no extension and some directories have a dot in their name so this is not cutting it.</p>