Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Magic Path" (\\?\) on windows does not work #27

Open
helmesjo opened this issue Aug 21, 2023 · 0 comments
Open

"Magic Path" (\\?\) on windows does not work #27

helmesjo opened this issue Aug 21, 2023 · 0 comments

Comments

@helmesjo
Copy link

helmesjo commented Aug 21, 2023

The following snippet will not return the expected subdir:

// long path
auto dummy = std::filesystem::temp_directory_path() / "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooonooooooooog" / "dummy" / "dummy";
// prefix with the magic '\\?\' shenanigans
dummy = std::filesystem::path("\\\\?\\" + dummy.string());

// directory is created fine
auto errorCode = std::error_code{};
std::filesystem::create_directories(dummy, errorCode);
assert(!errorCode);

// but globbing fails to find any subdirs. Shortening the path makes it work
const auto matchingEntries = glob::glob(dummy.parent_path().string() + "/*");
assert (!matchingEntries.empty());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant