-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
<filesystem>
support junctions in read_symlink
#2877
Conversation
* `is_symlink(junction) -> true` * `read_symlink(junction)` works * `copy_symlink(junction)` works
*_symlink
<filesystem>
support junctions in *_symlink
STL/tests/std/tests/P0218R1_filesystem/test.cpp Line 2885 in ef62d3f
Ideally, it's best to run a full test pass for x64 before submitting a PR. (For maintainers, if your local machine is slow, you can create a VM internally to run tests.) At a minimum, strongly related tests should be run, which will take just a few minutes. For example:
|
I'm all for treating junctions as symlinks, but I'm not sure about some details.
|
@cpplearner you're absolutely correct, thanks for pointing that out. |
<filesystem>
support junctions in *_symlink
<filesystem>
support junctions in read_symlink
* `is_symlink(junction) = false` * `copy_symlink(junction)` fails * `copy(junction)` succeeds and creates a junction * `read_symlink(junction)` correctly reads a junction
Waiting on LWG issue to link. |
We now have a LWG issue - LWG-3744! |
Thanks for fixing this bug! I pushed minor stylistic changes, nothing should be controversial but please meow if you have concerns. 😺 |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for yet another |
Co-authored-by: nicole mazzuca <mazzucan@outlook.com> Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
I'm confused about the reasoning for is_symlink () returning false for juntions. How is one to know to call read_symlink? https://en.cppreference.com/w/cpp/filesystem/read_symlink says its an error to call read_symlink for soemthing that isn't a symlink. My code: doesn't work with our chosen fix. Not sure why the above should not work? |
is_symlink(junction)
is stillfalse
read_symlink(junction)
works and does the obvious thingcopy_symlink(junction)
doesn't work - creating a directory symlink is bad, and creating a junction is not really supported by the windows API (and also a junction is not a symlink)copy(junction)
works and does the obvious thingFixes #2818