peteraritchie / LongPath

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

Consider checking for error upon subdirectory creation in Directory.CreateDirectory #96

Open peteraritchie opened 1 year ago

peteraritchie commented 1 year ago

In Directory.CreateDirectory, a directory may exist but may not be visible to the current user and incorrectly get flagged for creation. While creating that subdir in this scenario, we should check for an error and not let it leak out if the directory exists. See also https://github.com/dotnet/runtime/blob/main/src/libraries/Common/src/System/IO/FileSystem.DirectoryCreation.Windows.cs#L78