This project is read-only.

Directory.Delete throws IOException "The directory is not empty"

Apr 2, 2014 at 8:24 PM
When I call Directory.Delete(path, false) where path is a long file path and the directory is empty, an IOException is thrown. When I repeat the same test where path is not a long file path, the method works as expected.

I looked at the AlphaFS source and saw that Directory.DeleteDirectoryInternal is calling NativeMethods.PathIsDirectoryEmpty and passing in the long file path. The MSDN documentation seems to indicate that path cannot be longer than MAX_PATH. I am assuming this is 260 characters.

http://msdn.microsoft.com/en-us/library/windows/desktop/bb773623(v=vs.85).aspx

Is this an error in the MSDN documentation or is AlphaFS erroneously passing a long path to a method that does not support long paths?
Developer
Apr 3, 2014 at 7:21 AM
Hi,

The MSDN documentation is correct.

The function has also been removed a few changesets ago.
Marked as answer by sdebussc on 4/3/2014 at 5:33 AM
Apr 3, 2014 at 1:33 PM
Yomodo wrote:
Hi,

The MSDN documentation is correct.

The function has also been removed a few changesets ago.
Okay, thank you.