-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Tracking Issue for junction_point
#121709
Comments
…acrum Implement junction_point Implements rust-lang#121709 We already had a private implementation that we use for tests so we could just make that public. Except it was very hacky as it was only ever intended for use in testing. I've made an improved version that at least handles path conversion correctly and has less need for things like the `Align8` hack. There's still room for further improvement though.
Rollup merge of rust-lang#121711 - ChrisDenton:junction, r=Mark-Simulacrum Implement junction_point Implements rust-lang#121709 We already had a private implementation that we use for tests so we could just make that public. Except it was very hacky as it was only ever intended for use in testing. I've made an improved version that at least handles path conversion correctly and has less need for things like the `Align8` hack. There's still room for further improvement though.
Some concerns/questions about the current implementation:
|
The current implementation was adapted from an internal-only function that was used for testing filesystem behaviour on junction points. Doubtless it can be improved further, PRs welcome!
Sure.
No, it actually doesn't need to be followed by any nulls seeing as the length is given in another field. Any implementation that reads the paths and assumes null termination is wrong. We could null terminate as a courtesy to "wrong" code, though such code will be broken on other input. I don't see any need to have a double null. The buffer is not like a flexible array, it can only ever contain exactly two strings which are pointed to by the offset fields.
Yes.
From the DeviceIoControl documentation:
|
That is correct; however, if I'm counting things right, By the way, just as an interesting observation, PowerShell
Ah you're right; I've looked at that documentation page many times but somehow always skipped that part. |
Ah, I see. We really shouldn't be hard coding sizes here. Note though that's only really two null u16 characters, which equates to null terminating each string. Adding null termination makes sense and it would also be better to calculate the sizes and offsets properly rather than using magic numbers.
The intent of the |
Feature gate:
#![feature(junction_point)]
This is a tracking issue for rust-lang/libs-team#203
On Windows, it allows creating a juncture point. Which is useful if/when symlinks are not enabled.
Public API
Steps / History
Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: