Closed herebebeasties closed 7 years ago
I can't seem to reproduce this with a long path. I created a test with the following body:
var tempLongPathFilename =
Path.Combine(longPathDirectory, Path.GetRandomFileName())
.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
var di = new DirectoryInfo(tempLongPathFilename);
di.Create();
Assert.IsTrue(di.Exists);
di.Delete(recursive: true);
Is there some other information you can give me to help me reproduce this?
It's possible that head doesn't reproduce this - I have a slightly old version. Will update and let you know (sorry - I realise people like me who aren't on the latest version are a pain in the ass for bug reports, but I looked at the newer code and thought it'd behave in the same way).
In the Path class:
...throws an index out of bounds exception if you give it a path containing only forward-slashes (
AltDirectorySeparatorChar
). I think theSplit
should be for either. This occurs if you try to callDirectory.Create()
with a long path (i.e. > MAX_PATH chars) with forward-slashes, for example.(Apologies - I'm behind an office firewall where I can't make a pull request / tests for this. :-( )