peteraritchie / LongPath

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

CreateDirectory can fail due to race condition #43

Closed herebebeasties closed 7 years ago

herebebeasties commented 7 years ago

You have the following in Directory.cs:

// To mimic Directory.CreateDirectory, we don't throw if the directory (not a file) already exists
...
// PR: Not sure this is even possible, we check for existance above.

You've obviously decided that it's not possible, and have commented out the code that deals with this (sorry I can't paste it here from work - my HTTP proxy blocks stuff that looks like code).

What happens if two people call this method at once from different threads? This then throws, which it should not. :-(