Directory.GetDirectories/GetFiles/GetFileSystemEntries cannot use longpath


OS : Windows7 64bit Professional
.NET : 3.5
AlphaFS : 112217

Directory.GetDirectories/GetFiles/GetFileSystemEntries throws DirectoryNotFoundException when path is long.
Of course, older versions(111486,111862) can use long Path.
Can you help me?
Closed Jan 8, 2015 at 5:39 PM by decaf


Yomodo wrote Jan 5, 2015 at 10:00 AM


Those overloaded methods with IsFullPath support have been removed to
because the number of overloaded methods was growing large and hard to maintain.

However, as an alternative, you can use: Directory.EnumerateFileSystemEntryInfos()

For example:
foreach (var fsei in Directory.EnumerateFileSystemEntryInfos<FileSystemEntryInfo>(path, Path.WildcardStarMatchAll, DirectoryEnumerationOptions.Recursive, true)) {}
foreach (var fsei in Directory.EnumerateFileSystemEntryInfos<string>(path, Path.WildcardStarMatchAll, DirectoryEnumerationOptions.FilesAndFolders | DirectoryEnumerationOptions.Recursive, true)) {}
Please note that we will be leaving CodePlex soon.
AlphaFS will continue on GitHub.

hnorihiro wrote Jan 7, 2015 at 6:31 AM

  • Directory.CreateDirectory
    • Long path : supported
  • Directory.GetFileSystemEntries
    • Long path : unsupported
As above example, the methods which support long path and those which do not support are mixed.
How can I distinguish these ?

decaf wrote Jan 7, 2015 at 9:31 AM

I cannot reproduce the problem you are describing on the latest build (from GitHub). Directory.GetFileSystemEntries() works just as expected with a long path, regardless of whether using the long path prefix or not.

hnorihiro wrote Jan 8, 2015 at 12:57 AM

OK, I understood it.

wrote Jan 8, 2015 at 5:39 PM