-
Notifications
You must be signed in to change notification settings - Fork 717
fix: resolve symbolic links through IO.FS.realPath on windows
#8534
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
Conversation
|
Mathlib CI status (docs):
|
| if (memcmp(res, "\\\\?\\", 4) == 0) { | ||
| if (memcmp(res + 4, "UNC\\", 4) == 0) { | ||
| // network path: convert "\\\\?\\UNC\\..." to "\\\\..." | ||
| res[6] = '\\'; | ||
| res += 6; | ||
| } else { | ||
| // simple path: convert "\\\\?\\C:\\.." to "C:\\..." | ||
| res += 4; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this adopted from anywhere else, any other reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally Cameron told me about this stackoverflow post. It also seems like some implementations have something similar, e.g. java's file code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, from the documentation here: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
The "\\?\" prefix can also be used with paths constructed according to the universal naming convention (UNC). To specify such a path using UNC, use the "\\?\UNC\" prefix.
…prover#8534) This PR fixes `IO.FS.realPath` on windows to take symbolic links into account. Closes leanprover#810
…prover#8534) This PR fixes `IO.FS.realPath` on windows to take symbolic links into account. Closes leanprover#810
This PR fixes
IO.FS.realPathon windows to take symbolic links into account.Closes #810