Closed DizzyHSlightlyVoided closed 7 years ago
I've just did a test:
var dirInfo1 = new ZlpDirectoryInfo(@"C:\Foo\Bar");
Console.WriteLine(dirInfo1.Name); //"Bar"
var dirInfo2 = new ZlpDirectoryInfo(@"C:\Foo\Bar\");
Console.WriteLine(dirInfo2.Name); //"", an empty string
var dirInfo3 = new DirectoryInfo(@"C:\Foo\Bar");
Console.WriteLine(dirInfo1.Name);
var dirInfo4 = new DirectoryInfo(@"C:\Foo\Bar\");
Console.WriteLine(dirInfo2.Name);
if( dirInfo1.FullName!=dirInfo3.FullName) throw new Exception(@"1-3");
if( dirInfo2.FullName!=dirInfo4.FullName) throw new Exception(@"2-4");
In my tests, the ZlpDirectoryInfo
classes resulted in the same strings as those DirectoryInfo
classes.
One sec while I try this with the exact path that was causing the issue ...
It seems to have something to do with the length. Or something. I got the effect when I used D:\SomeStuff\Name Space\More.Stuff\Test
This is on the latest NuGet release, by the way, 1.0.0.16
Sorry, my above tests are flawed. I'll can see the different behavior now.
Old, wrong tests:
if( dirInfo1.FullName!=dirInfo3.FullName) throw new Exception(@"1-3");
if( dirInfo2.FullName!=dirInfo4.FullName) throw new Exception(@"2-4");
New correct tests:
if( dirInfo1.Name!=dirInfo3.Name) throw new Exception(@"1-3");
if( dirInfo2.Name!=dirInfo4.Name) throw new Exception(@"2-4");
I'll fix this right now.
I've just updated the NuGet package und this GitHub repository.
As the title says: