Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Directory.EnumerateFileSystemEntryInfos does not return subdirectories with spaces as name. #369

Closed
Lupinho opened this issue Dec 22, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@Lupinho
Copy link

Lupinho commented Dec 22, 2017

Test:

  1. Create a subdirectory with name " ".
  2. Call Directory.EnumerateFileSystemEntryInfos for the parent directory
    The " "-directory will not be enumerated correctly.
    The bug is located in the method "private T NewFileSystemEntryType(bool isFolder, NativeMethods.WIN32_FIND_DATA win32FindData, string fileName, string pathLp)", where the behaviour is explicitely programmed - for an unkown reason:
    var fullPathLp = (IsRelativePath ? OriginalInputPath + Path.DirectorySeparator : pathLp) + (!Utils.IsNullOrWhiteSpace(fileName) ? fileName : string.Empty);
    I know, that a directory " " is somewhat named illegal, but you can create one with AlphaFS easily. Maybe, this wrong handling is programmed in other methods too (e.g. in File.CreateFileCore). I would appreciate a solution of this issue.
@Yomodo Yomodo added the Bug 🪲 label Jan 2, 2018
@Yomodo Yomodo self-assigned this Jan 2, 2018
@Yomodo
Copy link
Collaborator

Yomodo commented Jan 2, 2018

As far as I can test at the moment, as a temp alternative, this works OK:
var fullPathLp = (IsRelativePath ? OriginalInputPath + Path.DirectorySeparator : pathLp) + fileName;

@Yomodo Yomodo changed the title Directory.EnumerateFileSystemEntryInfos returns enumerated directory as subdirectory for subdirectories with spaces as name Directory.EnumerateFileSystemEntryInfos does not return subdirectories with spaces as name. Jan 5, 2018
@Yomodo Yomodo closed this as completed in 0b54b1c Jan 5, 2018
@Yomodo Yomodo added this to the Release 2.2 milestone Jan 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants