Skip to content
Tcl Source Code Artifact [1b2bd46b32]
Login

Artifact [1b2bd46b32]

Artifact 1b2bd46b328401e1ef518293185f58697a2b598ce788a8bd901edd9314ca06ce:

Ticket change [1b2bd46b32] - Ticket [c8d4f01a54d7ecf8|c8d4f01a54] <i>Windows: NTFS symbolic links are not supported by [file]</i> status still Open with 4 other changes by serhiy.storchaka on 2026-10-17 10:53:34.
D 2026-10-17T10:53:34.492
J foundin 8.6.18,\s9.0.5,\s9.1.0
J icomment Still\spresent\sin\s8.6.18,\s9.0.5\sand\s9.1\son\sWindows\s11:\s<nowiki>[file\sreadlink]</nowiki>\sfails\son\severy\sreal\ssymlink,\sand\sonly\sjunctions\swork:\n\n<verbatim>\n%\sfile\sreadlink\sdirlink\s\s\s\s\s\s;#\smklink\s/D\sdirlink\starget\ncould\snot\sread\slink\s"dirlink":\sinvalid\sargument\n%\sfile\sreadlink\sfilelink\s\s\s\s\s;#\smklink\sfilelink\sa.txt,\sor\s[file\slink\s-symbolic\sfilelink\sa.txt]\ncould\snot\sread\slink\s"filelink":\snot\sa\sdirectory\n</verbatim>\n\nSo\sa\sfile\slink\sthat\sTcl\sitself\shas\screated\swith\s<nowiki>[file\slink\s-symbolic]</nowiki>\ssince\s8.6.11\s([548cd945d6])\scannot\sbe\sread\sback.\n\nCause,\sin\swin/tclWinFile.c:\s<tt>WinReadLink()</tt>\sreturns\sENOTDIR\sfor\sanything\sthat\sis\snot\sa\sdirectory.\sFor\sdirectories,\s<tt>WinReadLinkDirectory()</tt>\sdoes\shave\sa\scase\sfor\ssymlinks,\sbut\sit\stests\s<tt>IO_REPARSE_TAG_SYMBOLIC_LINK</tt>.\sThe\sSDK\sand\smingw-w64\sheaders\sdo\snot\sdefine\sthat\sname\s(theirs\sis\s<tt>IO_REPARSE_TAG_SYMLINK</tt>,\s<tt>0xA000000C</tt>),\sso\sthe\sfallback\s<tt>#define\s...\sIO_REPARSE_TAG_RESERVED_ZERO</tt>\smakes\sit\s0.\sThe\ssymlink\stag\snever\smatches\sand\sthe\sfunction\sends\sin\sEINVAL.\sThe\ssame\sfunction\sis\sused\sby\s<tt>TclpObjNormalizePath()</tt>,\sso\sdirectory\ssymlinks\sin\sthe\smiddle\sof\sa\spath\sare\snot\sresolved\sby\s<nowiki>[file\snormalize]</nowiki>\seither.\sA\sfix\sneeds\smore\sthan\sthe\sconstant:\ssymlink\sreparse\sdata\suses\s<tt>SymbolicLinkReparseBuffer</tt>\s(it\shas\san\sextra\s<tt>Flags</tt>\sfield\sand\scan\shold\sa\srelative\starget),\snot\s<tt>MountPointReparseBuffer</tt>,\sand\sthe\sname\sshould\sbe\sread\sat\s<tt>SubstituteNameOffset</tt>.
J login serhiy.storchaka
J mimetype text/x-fossil-wiki
K c8d4f01a54d7ecf819f4881fb02467ad14fc7b0c
U serhiy.storchaka
Z 20351b1f002f77202a2b8324156d62c3