peteraritchie / LongPath

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

Infinite sequence of elements when traversing the directory name consisting of single space #80

Closed ForNeVeR closed 4 years ago

ForNeVeR commented 5 years ago

Create the directory "C:\Temp\ \" (the last directory name consists of single space and nothing else). Now call Directory.EnumerateFileSystemEntries(@"C:\Temp\ \", "*.*", SearchOption.AllDirectories).

The method from the LongPath package will return an infinite sequence of elements for this directory; the method from System.IO namespace will not.

peteraritchie commented 4 years ago

I can't reproduce with the latest version. I get an empty sequence with LongPath. Oddly, System.IO returns one element with a non-existant file "c:\temp\ \ ". 🤷‍♂

ForNeVeR commented 4 years ago

Okay, I'll try to reproduce this in my spare time and close if it has been fixed. Thanks for info.

Also, I can confirm that System.IO is very broken with these outworldish paths.

ForNeVeR commented 4 years ago

I can confirm that this issue couldn't be reproduced in Pri.LongPath version 2.0.53. Thanks for your work!