glob
glob copied to clipboard
Windows paths starting with `\\?\<Drive Letter>` do not work
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
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
Noticed this same issue on Windows
As a workaround, removing the prefix \\?\ works
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).