Closed sebastienros closed 2 years ago
Apparently I made a mistake and it happens when calling CreateDirectory("/")
specifically.
I am doing fs.CreateDirectory(path.GetDirectory());
and in this case the path was /index.html
. I would still expect it not to throw.
What type of fs
is?
Happened with MemoryFileSystem
.
Yeah, it's a bug
Fixed by commit f1e9350
Like the standard
System.IO
API to create a directory, it processes all segments in the path. However when using something likefs.CreateDirectory("/a/b/c");
in Zio it will fail withSystem.UnauthorizedAccessException : Cannot create root directory '/'
.I would have expected it to ignore
/
since it already exists.