Given a path (that may be relative), how am I able to check if the path is a directory, or a guid, or a file. They might not exist which is what is making it difficult for me to figure out a solution to.
My previous solution was to check if the path was an extension like so:
public bool IsDirectory(string path)
{
var extension = Path.GetExtension(path);
return string.IsNullOrEmpty(extension);
}
But I discovered that this path will commonly also be a path to a guid, so the above will be incorrect.
Is there a better way I can write a function to check all these cases?