Skip to content
Tcl Source Code History Of Ticket b0682c3c24
Login

History Of Ticket b0682c3c24

Artifacts Associated With Ticket b0682c3c24

  1. Ticket change [ea513ab823] (rid 241112) by anonymous on 2025-06-10 09:40:06:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-plain"
    4. comment initialized to:
      I have the following strange behaviour under Windows 10 with tcl_patchLevel=9.0.0 (and tcl_patchLevel=9.0.1 from BAWT)
      
      (bin) 1 % set tcl_patchLevel
      9.0.0
      (bin) 2 % glob Z:/Basistests/200*
      Z:/Basistests/2000_00_00 {Z:/Basistests/2000_00_00 - Test}
      (bin) 3 % glob -types d Z:/Basistests/200*
      Z:/Basistests/2000_00_00 {Z:/Basistests/2000_00_00 - Test}
      (bin) 4 % glob -types d -directory Z:/Basistests -tails Z:/Basistests 200*
      Z:Basistests 2000_00_00 {2000_00_00 - Test}
      (bin) 5 % glob -types d -directory Z:/Basistests -tails Z:/Basistests Z:/Basistests/200*
      couldn't read directory "Z:/Basistests/Z:Basistests/200*": not a directory
      
      Under tcl8 I got:
      
      (ABS) 1 % glob -types d -directory Z:/Basistests -tails Z:/Basistests 200*
      2000_00_00 {2000_00_00 - Test}
      (ABS) 2 % glob -types d -directory Z:/Basistests -tails Z:/Basistests Z:/Basistests/200*
      no files matched glob patterns "Z:/Basistests Z:/Basistests/200*"
      
      The additional string "Z:Basistests" on command 4 is wrong.
      
      Even more perplexing is the following (under Tcl/Tk 9.0.0):
      
      (ABS) 1 % glob -types d -directory Z:/Basistests -tails Z:/Basistests 200*
      Z:Basistests 2000_00_00 {2000_00_00 - Test}
      (ABS) 2 % cd Z:Basistests
      (Basistests) 3 % pwd
      Z:/Basistests
      (Basistests) 4 % cd C:
      () 5 % cd Z:Basistests
      (Basistests) 6 % cd 2000_00_00
      (2000_00_00) 7 % cd Z:Basistests
      couldn't change working directory to "Z:Basistests": no such file or directory
      (2000_00_00) 8 %
      
    5. foundin initialized to: "9.0.0 9.0.1"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Important"
    11. status initialized to: "Open"
    12. submitter initialized to: "anonymous"
    13. subsystem initialized to: "- New Builtin Commands"
    14. title initialized to: "glob error"
    15. type initialized to: "Bug"
  2. Ticket change [a32b0ae555] (rid 243398) by sebres on 2025-07-21 19:15:09:

    1. icomment:
      If I understand it correctly (please provide short "diff", what is expected and what is wrong result), it may be a side effect of bug [61c01e0edb08a9ed], because looks really similar to us.
      
      If so it shall be fixed now. Please test again with the fixed version.
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  3. Ticket change [e3e8fccf7d] (rid 245930) by anonymous on 2025-09-25 12:52:31:

    1. icomment: "Still the same under tcl 9.0.2 :("
    2. login: "anonymous"
    3. mimetype: "text/plain"
  4. Ticket change [a4c316b177] (rid 245941) by juliannoble2 on 2025-09-25 16:31:19:

    1. icomment:
      I also see this on a recent 9.0.2 build 
      
      Paths such as Z:Basistests are volume-relative
      Tcl doesn't support the per-volume cwd - there are long-standing bugs in this area when changing drives in Tcl as compared to what happens in cmd.exe or powershell.
      
      
      If you cd to Z:/Basistests 
       for command 4 - you will see the Z:basistests entry is no longer present in the result.
       for command 5 - the 'couldn't read directory' error is not raised.
      
      glob with the -directory option, and no specific reference to volume-relative paths shouldn't change output based on the cwd.
      (and shouldn't return any volume relative paths)
      
      
      I've argued in a previous ticket that it may be worth considering removing volume-relative path support.
      I'd really prefer it was supported - but there are still footguns regarding the cd command and comparing glob output to external tools/commands view of things due to the occasional difference in ideas of what is the actual current working directory for a drive.
      
      The example given above of cd c: & cd Z:Basistests can be a problem with tcl8 too - as it can depend on what directory you were in when starting tclsh.
      
      Perhaps in this case we can at least make glob handle things better, even if a full fix-up of the volume-relative path problems isn't something anyone is able to delve into now.
      
    2. login: "juliannoble2"
    3. mimetype: "text/plain"
  5. Ticket change [745924f882] (rid 246905) by dkf on 2025-10-07 15:31:10:

    1. login: "dkf"
    2. mimetype: "text/plain"
    3. subsystem changed to: "37. File System"
  6. Ticket change [58497f4248] (rid 248203) by anonymous on 2025-11-14 07:48:15:

    1. icomment: "It seems the error is gone in tcl9.0.3."
    2. login: "anonymous"
    3. mimetype: "text/plain"
  7. Ticket change [aa2a0c3ed2] (rid 248240) by anonymous on 2025-11-14 13:22:37:

    1. icomment:
      Sorry, the error gone in tcl9.0.3 is not true :(
      The strange Z:Basistests still exists.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  8. Ticket change [30f75b7c06] (rid 252223) by apnadkarni on 2026-03-18 16:04:36:

    1. comment changed to:
      I have the following strange behaviour under Windows 10 with tcl_patchLevel=9.0.0 (and tcl_patchLevel=9.0.1 from BAWT)
      
      (bin) 1 % set tcl_patchLevel
      9.0.0
      (bin) 2 % glob Z:/Basistests/200*
      Z:/Basistests/2000_00_00 {Z:/Basistests/2000_00_00 - Test}
      (bin) 3 % glob -types d Z:/Basistests/200*
      Z:/Basistests/2000_00_00 {Z:/Basistests/2000_00_00 - Test}
      (bin) 4 % glob -types d -directory Z:/Basistests -tails Z:/Basistests 200*
      Z:Basistests 2000_00_00 {2000_00_00 - Test}
      (bin) 5 % glob -types d -directory Z:/Basistests -tails Z:/Basistests Z:/Basistests/200*
      couldn't read directory "Z:/Basistests/Z:Basistests/200*": not a directory
      
      Under tcl8 I got:
      
      (ABS) 1 % glob -types d -directory Z:/Basistests -tails Z:/Basistests 200*
      2000_00_00 {2000_00_00 - Test}
      (ABS) 2 % glob -types d -directory Z:/Basistests -tails Z:/Basistests Z:/Basistests/200*
      no files matched glob patterns "Z:/Basistests Z:/Basistests/200*"
      
      The additional string "Z:Basistests" on comcd mand 4 is wrong.
      
      Even more perplexing is the following (under Tcl/Tk 9.0.0):
      
      (ABS) 1 % glob -types d -directory Z:/Basistests -tails Z:/Basistests 200*
      Z:Basistests 2000_00_00 {2000_00_00 - Test}
      (ABS) 2 % cd Z:Basistests
      (Basistests) 3 % pwd
      Z:/Basistests
      (Basistests) 4 % cd C:
      () 5 % cd Z:Basistests
      (Basistests) 6 % cd 2000_00_00
      (2000_00_00) 7 % cd Z:Basistests
      couldn't change working directory to "Z:Basistests": no such file or directory
      (2000_00_00) 8 %
      
    2. icomment:
      Potential fix in the [bug-b0682c3c24](https://core.tcl-lang.org/tcl/timeline?r=bug-b0682c3c24) branch. But see below.
      
      ```
      % glob d:/Basistests/200*
      d:/Basistests/2000_00_00 {d:/Basistests/2000_00_00 - Test}
      % glob -types d d:/Basistests/200*
      d:/Basistests/2000_00_00 {d:/Basistests/2000_00_00 - Test}
      % glob -types d -directory d:/Basistests -tails d:/Basistests 200*
      2000_00_00 {2000_00_00 - Test}
      % glob -types d -directory d:/Basistests -tails d:/Basistests d:/Basistests/200*
      %
      ```
      
      which seems reasonable to me. The cd issues in the original ticket I didn't quite understand as it seems to be it depends on what the "current directory" on the other drive happened to be.
      
      In the existing implementation, glob correctly parses the `-directory` and pattern into components `d:/basictests`, `d:` and `basictests`. However when checking for existence, the implementation invokes `Tcl_FSTranslatePath` which reparses the path by calling `TclJoinPath` which behaves as the script level `join` command which discards any components prior to anything an absolute or volume-relative component. In this case `d:` is the volume relative component so the existence check is made against "d:Basictests". The result will then depend on whether the "current directory" on drive D: is the root or not.
      
      As a fix, it seems to me that `Tcl_FSGetTranslatedPath` is broken in this behaviour. Not only is this "join-like" behaviour mentioned anywhere in the documentation, I also think it does not make semantic sense. The function is supposed to translate a single path and should not be discarding any components. In particular on Unix, it already behaves this way by not treating a leading `/` in a pattern as an absolute path.
      
      ```
      % glob -directory /tmp /foo
      /tmp/foo
      ```
      
      I therefore consider this as a bug fix and not a change to defined or expected `Tcl_FSGetTranslatedPath` behavior (which would require a TIP).
      
      Opinions?
      
    3. login: "apnadkarni"
    4. mimetype: "text/x-markdown"
  9. Ticket change [19d58ec013] (rid 252225) by apnadkarni on 2026-03-18 16:20:36:

    1. icomment:
      Regarding the cd issue, I've logged [bca391ab51] as a separate issue. May be that is what the ticket was referring to.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-fossil-plain"
  10. Ticket change [ca18c9cc2d] (rid 252325) by apnadkarni on 2026-03-25 03:31:11:

    1. closedate changed to: "2461124.6466561225"
    2. closer changed to: "apnadkarni"
    3. icomment: "Fixed in [874e86e528]."
    4. login: "apnadkarni"
    5. mimetype: "text/x-fossil-plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"