Repository navigation
<filesystem>: read_symlink does not work with junctions #2077
Description
Activity
SibiSiddharthan commented
on Jul 25, 2021 ContributorAuthorMore actionsI tried debugging this and here are my findings.
When we do
DeviceIoControlwithFSCTL_GET_REPARSE_POINT, if theHANDLErefers to a symlinked file theReparseTagreads
2684354572which isIO_REPARSE_TAG_SYMLINK (0xA000000C). But if theHANDLEpoints to junction theReparseTagreads
2684354563which isIO_REPARSE_TAG_SYMLINK - 9. I am not sure why this happens.Another weird thing
If the
HANDLErefers to a symlinked file, theSymbolicLinkReparseBuffer.Flagsreads1which isSYMLINK_FLAG_RELATIVE 0x1andB->SymbolicLinkReparseBuffer.PathBufferreads the relative path wrt the current working directory. This is as expected. But
when theHANDLErefers to a junction , theSymbolicLinkReparseBuffer.Flagsreads4128860? andB->SymbolicLinkReparseBuffer.PathBufferreads the absolute path excluding the volume. Is this expected behavior or am I missing something?SibiSiddharthan commented
on Jul 25, 2021 ContributorAuthorMore actionsI got confused between
IO_REPARSE_TAG_MOUNT_POINTandIO_REPARSE_TAG_SYMLINK. Things work as expected. Sorry about this. Closing this issue.- addedinvalidThis issue is incorrect or by designThis issue is incorrect or by design
on Aug 8, 2021 - added 5 commits that reference this issue
on Nov 7, 2025 - added a commit that references this issue
on Nov 17, 2025 - added a commit that references this issue
on Nov 17, 2025 - added a commit that references this issue
on Nov 18, 2025 - added a commit that references this issue
on Jan 21, 2026
Command-line test case
STL version
9a9820d