-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: Root ignores link type on Windows #71166
Comments
/cc @qmuntal |
Related Issues (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Open question: How do you tell what kind of link an IO_REPARSE_TAG_SYMLINK reparse point is? I don't see anything in the reparse buffer that identifies it. |
We already know if an stat'ed symbolic links points to a directory, as we get this information in here: Lines 47 to 48 in 39f2032
That problem is that Lines 193 to 195 in 39f2032
What does Unix does in this case? Does it set the |
In Unix a symbolic link is just a name forwarder. There is no difference between a link to a file and a link to a directory, and in fact you can change the destination from a file to a directory, or vice-versa, without affecting the symbolic link. So, no, a symbolic link will never have |
To make things more confusing:
With this setup:
I don't know why this is. From the command line, |
Windows makes a distinction between symlinks to a file and to a directory. A file link pointing to a directory cannot be traversed, nor can a directory link pointing to a file.
The
os.Root
type doesn't pay attention to link types when resolving files, however, and will follow links that Windows will not. It probably should behave consistently with the rest of the OS.(See also #71165, which is the same issue in path/filepath.EvalSymlinks.)
The text was updated successfully, but these errors were encountered: