While I was reading about the method System.IO.File.Exists(string path)
, I was puzzled by the sentence
The Exists method should not be used for path validation, this method merely checks if the file specified in path exists.
To me the two statements "File in this path exists" and "the path [to the file] is valid" are almost synonyms, so I'm missing something. What? Why shouldn't I validate a path with File.Exists()
?