Skip to content
Tcl Source Code History Of Ticket c8d4f01a54
Login

History Of Ticket c8d4f01a54

Artifacts Associated With Ticket c8d4f01a54

  1. Ticket change [91379c2f80] (rid 143030) by anonymous on 2015-09-04 14:28:36:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Tcl supports NTFS junctions, but not NTFS symbolic links.
      [file link], [file readlink] etc. all fail with messages about not a directory.
      
    5. foundin initialized to: "8.6.3"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "e755306c9ef019bc4ca35d69adcf001dece786ff"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "16. Commands A-H"
    15. title initialized to:
      Windows: NTFS symbolic links are not supported by [file]
      
    16. type initialized to: "Bug"
  2. Ticket change [03c6ab97e3] (rid 143044) by dkf on 2015-09-08 08:56:43:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Strictly, it's new functionality, but it would be nice to have.
      
    3. login: "dkf"
    4. mimetype: "text/x-fossil-wiki"
    5. subsystem changed to: "37. File System"
    6. type changed to: "RFE"
    7. username: "dkf"
  3. Ticket change [f24b075b11] (rid 144984) by apnadkarni on 2016-02-25 07:47:40:

    1. icomment:
      Some comments for future reference.
      
      As of 8.6.5, file link translates to NTFS junctions for directories and hard links for files. If support for symbolic links is added, will need to decide if the [file link -symbolic] for dirs which currently uses junctions will be changed to use symbolic links instead and any backward compatibility issues that may arise.
      
      Also, symbolic links are not supported on XP.
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  4. Ticket change [dfce61662e] (rid 170050) by kjnash on 2019-03-11 21:07:22:

    1. icomment:
      Yes, it would be nice to have.
      
      Even if the existing behaviour of [file link -symbolic $F1 $F2] for creating a link is preserved until the next major revision, it would be very useful if [file link $F1], [file isdirectory $F1], [file stat $F1] etc returned valid results for Windows symlinks created outside Tcl.
      
    2. login: "kjnash"
    3. mimetype: "text/plain"
  5. Ticket change [b66bb4c5e0] (rid 233768) by juliannoble2 on 2024-09-22 05:31:05:

    1. icomment:
      I think (just a feeling - no real evidence) these types of links - which behave more like unix symlinks are becoming more important/used.
      I'm not sure of the platform differences though.
      
      Can we add it to the list of known bugs so that it eventually gets some love?
      
    2. login: "juliannoble2"
    3. mimetype: "text/plain"
  6. Ticket change [1decde46a7] (rid 249979) by apnadkarni on 2025-12-28 17:57:13:

    1. icomment:
      On the radar, but will trigger some subtle compatibility differences with 9.0 behavior and some limitations w.r.t. usage (compared to Unix, and stemming from Windows itself)
      
      Advantages
      
      - ReFS does not support junctions but does support symbolic links
      - relative paths permitted
      - cross-volume links permitted (afaik)
      - closer compatibility with POSIX links (relative paths being the most obvious)
      
      Disadvantages
      
      - Requires either admin privileges or running in developer mode. This is the biggest drawback.
      - Different behaviour from 9.0 `file link` on Windows but possible this might be hand waved away.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  7. Ticket change [1b2bd46b32] (rid 258537) by serhiy.storchaka on 2026-10-17 10:53:34:

    1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
    2. icomment:
      Still present in 8.6.18, 9.0.5 and 9.1 on Windows 11: <nowiki>[file readlink]</nowiki> fails on every real symlink, and only junctions work:
      
      <verbatim>
      % file readlink dirlink      ;# mklink /D dirlink target
      could not read link "dirlink": invalid argument
      % file readlink filelink     ;# mklink filelink a.txt, or [file link -symbolic filelink a.txt]
      could not read link "filelink": not a directory
      </verbatim>
      
      So a file link that Tcl itself has created with <nowiki>[file link -symbolic]</nowiki> since 8.6.11 ([548cd945d6]) cannot be read back.
      
      Cause, in win/tclWinFile.c: <tt>WinReadLink()</tt> returns ENOTDIR for anything that is not a directory. For directories, <tt>WinReadLinkDirectory()</tt> does have a case for symlinks, but it tests <tt>IO_REPARSE_TAG_SYMBOLIC_LINK</tt>. The SDK and mingw-w64 headers do not define that name (theirs is <tt>IO_REPARSE_TAG_SYMLINK</tt>, <tt>0xA000000C</tt>), so the fallback <tt>#define ... IO_REPARSE_TAG_RESERVED_ZERO</tt> makes it 0. The symlink tag never matches and the function ends in EINVAL. The same function is used by <tt>TclpObjNormalizePath()</tt>, so directory symlinks in the middle of a path are not resolved by <nowiki>[file normalize]</nowiki> either. A fix needs more than the constant: symlink reparse data uses <tt>SymbolicLinkReparseBuffer</tt> (it has an extra <tt>Flags</tt> field and can hold a relative target), not <tt>MountPointReparseBuffer</tt>, and the name should be read at <tt>SubstituteNameOffset</tt>.
      
    3. login: "serhiy.storchaka"
    4. mimetype: "text/x-fossil-wiki"
  8. Ticket change [d02196d5fb] (rid 259008) by serhiy.storchaka on 2026-10-18 13:54:20:

    1. icomment:
      Proposed fix in branch [/timeline?r=win-readlink-symlinks|win-readlink-symlinks]: <nowiki>[file readlink]</nowiki> now reads symbolic links to files and directories. Relative targets are returned as stored, like on Unix, and <tt>\??\UNC\server\share</tt> targets as <tt>\\server\share</tt>. <nowiki>[file normalize]</nowiki> resolves directory symlinks inside a path. Tests winFile-5.1 to 5.5 (all but 5.2 and 5.4 need the right to create symbolic links).
      
      Only reading is changed: <nowiki>[file link -symbolic]</nowiki> still creates junctions for directories, so the compatibility question about creating links remains open.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  9. Ticket change [991db203ea] (rid 261565) by serhiy.storchaka on 2026-11-13 11:18:46:

    1. login: "serhiy.storchaka"
    2. type changed to: "Bug"
  10. Ticket change [ec2814aa01] (rid 263411) by jan.nijtmans on 2026-11-27 15:23:03:

    1. icomment: "Merged to [91dee7634c|trunk]"
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Fixed"
    5. status changed to: "Pending"