Artifacts Associated With Ticket b0682c3c24
Ticket change [ea513ab823] (rid 241112) by anonymous on 2025-06-10 09:40:06:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- 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 % - foundin initialized to: "9.0.0 9.0.1"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to: "glob error"
- type initialized to: "Bug"
Ticket change [a32b0ae555] (rid 243398) by sebres on 2025-07-21 19:15:09:
- 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.
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [e3e8fccf7d] (rid 245930) by anonymous on 2025-09-25 12:52:31:
- icomment: "Still the same under tcl 9.0.2 :("
- login: "anonymous"
- mimetype: "text/plain"
Ticket change [a4c316b177] (rid 245941) by juliannoble2 on 2025-09-25 16:31:19:
- 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.
- login: "juliannoble2"
- mimetype: "text/plain"
- icomment:
Ticket change [745924f882] (rid 246905) by dkf on 2025-10-07 15:31:10:
- login: "dkf"
- mimetype: "text/plain"
- subsystem changed to: "37. File System"
Ticket change [58497f4248] (rid 248203) by anonymous on 2025-11-14 07:48:15:
- icomment: "It seems the error is gone in tcl9.0.3."
- login: "anonymous"
- mimetype: "text/plain"
Ticket change [aa2a0c3ed2] (rid 248240) by anonymous on 2025-11-14 13:22:37:
- icomment:
Sorry, the error gone in tcl9.0.3 is not true :( The strange Z:Basistests still exists.
- login: "anonymous"
- mimetype: "text/plain"
- icomment:
Ticket change [30f75b7c06] (rid 252223) by apnadkarni on 2026-03-18 16:04:36:
- 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 % - 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? - login: "apnadkarni"
- mimetype: "text/x-markdown"
- comment changed to:
Ticket change [19d58ec013] (rid 252225) by apnadkarni on 2026-03-18 16:20:36:
- icomment:
Regarding the cd issue, I've logged [bca391ab51] as a separate issue. May be that is what the ticket was referring to.
- login: "apnadkarni"
- mimetype: "text/x-fossil-plain"
- icomment:
Ticket change [ca18c9cc2d] (rid 252325) by apnadkarni on 2026-03-25 03:31:11:
- closedate changed to: "2461124.6466561225"
- closer changed to: "apnadkarni"
- icomment: "Fixed in [874e86e528]."
- login: "apnadkarni"
- mimetype: "text/x-fossil-plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"