Bug? File.Exists Bug?

Erel

Administrator
Staff member
Licensed User
No. File.Exists will return true if the specified path exists, even if it is a folder.
 

imbault

Well-Known Member
Licensed User
Sorry but the online help says:
"Return true if the specified FileName exists in the specified Dir." or in my exemple filename is ""
 

Erel

Administrator
Staff member
Licensed User
You are correct that the documentation is not clear enough. I've changed it to:
"Returns true if the specified FileName exists (file or folder) in the specified Dir."
The full path is created by combining Dir and FileName as if you called File.Combine. There are some exceptions related to special virtual folders.
 
Top