Possible Duplicate:
.NET How to check if path is a file and not a directory?
Hi,
Can anyone think of a good way of telling whether a file system object path equates to a a file or a directory?
I did have the following method:
public static bool PathIsFile(this string fullPath)
{
return (Path.GetExtension(fullPath).Length > 0);
}
But some files have no extension and some directories have a dot in their name so this is not cutting it.
Thanks
Paul
DUPILCATE http://stackoverflow.com/questions/439447/net-how-to-check-if-path-is-a-file-and-not-a-directory