glob icon indicating copy to clipboard operation
glob copied to clipboard

Windows paths starting with `\\?\<Drive Letter>` do not work

Open MolotovCherry opened this issue 2 years ago • 5 comments

If you have a path C:\foo*, it works, but if you have a path with \\?\C:\foo*, it doesn't return anything. The \\?\ is a valid path and works in other parts of the Rust std library.

Workaround for now: Strip \\?\ from the beginning of the path

MolotovCherry avatar Jun 09 '23 16:06 MolotovCherry

I just ran into this error as well. This happens when a windows path in canonicalized via the standard library, resulting in a path that glob fails to function on

wmmc88 avatar Aug 01 '23 05:08 wmmc88

Noticed this same issue on Windows

As a workaround, removing the prefix \\?\ works

pavi2410 avatar Oct 13 '23 17:10 pavi2410

Note that removing the \\?\ prefix is not always the right thing to do. E.g. \\?\UNC\ should be converted to \\. Also there are some rarer paths which don't have a win32 equivalent (e.g. a path that ends with a dot or device that isn't currently mounted to a drive or directory).

ChrisDenton avatar Oct 13 '23 18:10 ChrisDenton