Open dmcardle opened 1 month ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Change https://go.dev/cl/604875 mentions this issue: path/filepath: Add test to demonstrate Rel() quirk on Windows
CC @neild @golang/windows
I agree with @dmcardle that \\?\
prefix should be ignored when comparing files in filepath.Rel
.
All tests in https://go-review.googlesource.com/c/go/+/604875 should pass.
Alex
Go version
go version devel go1.24-47cdc43289 Mon Aug 12 13:09:41 2024 -0400 windows/amd64
Output of
go env
in your module/workspace:What did you do?
.\all.bat
What did you see happen?
What did you expect to see?
The demo CL (https://go-review.googlesource.com/c/go/+/604875/3) contains several expectations, but I'll pick one. I'm particularly surprised that the relative path from basepath
\\?\C:\foo
to targpath\\?\C:\foo\bar
is an error instead ofbar
.I'm a little out of my depth, but this Microsoft documentation (https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#win32-file-namespaces) seems to indicate that
\\?\
is just a way of turning off string parsing in Windows APIs.I think it should be possible to work around this limitation, for instance by prefixing
\\?\
onto the parameters when they are already absolute paths.