-
Notifications
You must be signed in to change notification settings - Fork 13.3k
read_link cannot open some files reported as symbolic links on windows #28528
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
Comments
The problem is that The data structures are similar, the main difference being that symlinks have an additional flags field that mount-points don't have: https://msdn.microsoft.com/en-us/library/cc232006.aspx vs https://msdn.microsoft.com/en-us/library/cc232007.aspx This is where the changes are required: https://github.com/rust-lang/rust/blob/master/src/libstd/sys/windows/fs.rs#L345 |
Hey, I'd be keen to have a go at this issue. |
@SingingTree feel free! If you've got any questions, feel free to reach out to me on IRC (acrichto) or here. |
@alexcrichton I have some work in progress, and would like to discuss what I'm doing. What would be the best process for this? Should I create a PR and mark it as WIP, or would it be better to discuss the work in a fork, sans PR? |
Ah I'm fine discussing either here or with a PR, whichever you'd prefer! |
Soz I'm been slack on this. I've been working on it, but have a been a bit busier than anticipated, so if anyone else wants to grab this, go ahead, otherwise I'm hoping to continue when I've got a bit more time. |
I would like to take this on next weekend |
Thanks @pitdicker! |
rustc on Windows 7 32 bit:
Test program:
Create a symlink on Windows at
is_a_symlink
pointing tonot_a_symlink
andrun above program (working as intended):
This correctly identifies the file as a symlink and resolves it correctly.
If we instead creation a junction and follow the same steps, we can observe an
inconsistency between
file_type().is_symlink()
and the behavior offs::read_link
:(The key difference is the use of
mklink /J
to create a junction.)The output here shows that it is correctly detected as a symlink, but
read_link
chokes on it.I looked briefly at the implementation and I haven't the slightest clue what's
wrong (I'm not familiar with Windows).
The text was updated successfully, but these errors were encountered: