peteraritchie / LongPath

drop-in library to support long paths in .NET
GNU Lesser General Public License v3.0
112 stars 43 forks source link

Different behaviour between Directory instance Exists property and Directory.Exists() static method #31

Closed Arjailer closed 8 years ago

Arjailer commented 8 years ago

If I have an existing folder path that ends with a slash (e.g. "C:\test\folder\") then the static method Directory.Exists(@"C:\test\folder\") will find the folder and return true.

However, the instance property new Directory(@"C:\test\folder\").Exists always seems to return false. If I remove the final slash from the end then it finds the folder and returns true.

This is easy to work around (always use the Static method), but I would have expected both the instance property and static method to behave the same (as they do in System.IO.Directory).

peteraritchie commented 8 years ago

Do you mean DirectoryInfo.Exists? Directory is static and does not contain an Exists property.

peteraritchie commented 8 years ago

Can't reproduce in the latest code with DirectoryInfo.Exists.