Skip to content
Tcl Source Code History Of Ticket e6ca0b1b678f89f0
Login

History Of Ticket e6ca0b1b678f89f0

Artifacts Associated With Ticket e6ca0b1b678f89f0

  1. Ticket change [1b76888a0c] (rid 252376) by apnadkarni on 2026-03-31 05:20:16:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      (Copied from core mailing list)
      
      
      It seems to me then that Tcl on macos has at least one, and possibly up to three, bugs.
      
      Inconsistent case-sensitivity in matching. I expect
      
      ```
      glob /tmp/MIXEDCASE
      glob /tmp/M*
      ```
      
      both to either include MiXeDcAsE in the return or not, depending on case sensitivity of the file system. But the results do not match. Likewise for
      
      ```
      glob /tmp/mixedcase
      glob /tmp/m*
      ```
      
      I think this is a definite bug because it is inconsistent.
      
      Second *possible* bug is that Tcl does case-sensitive matching on macos when the expectation is case-insensitive. It's confusing for me because as per Google (and verified by Kevin), modern Macs have case-insensitive file systems by default. Mac users need to comment and take a call on this.
      
      
      (Not from the tests, but reading the code) file normalize possibly has the same bug it had on Windows where it did not actually normalize to a unique file system representation.
      
      
      For now, I’m disabling the tests I added on MacOS.
      
       
      ```
      -----Original Message-----
      From: Torsten Berg <be...@ty...> 
      Sent: Monday, March 30, 2026 11:30 PM
      To: <apn...@ya...> <apn...@ya...>
      Cc: tcl...@li...
      Subject: Re: [TCLCORE] Question for Mac users
      
      Using Tcl 8.6.16 on a macOS using an internal SSD formatted as APFS, not case-sensitive:
      
      () 1 % glob /tmp/MIXEDCASE
      /tmp/MIXEDCASE
      
      () 1 % glob /tmp/mixedcase
      /tmp/mixedcase
      
      () 1 % glob /tmp/MiXeDcAsE
      /tmp/MiXeDcAsE
      
      () 1 % glob /tmp/m*
      no files matched glob pattern "/tmp/m*"
      
       
      () 1 % glob /tmp/M*
      /tmp/MiXeDcAsE
      
      % tclsh9.1 
      % info pa
      9.1a1
      % glob /tmp/MIXEDCASE
      /tmp/MIXEDCASE
      
      ```
      
    5. foundin initialized to: "9.0"
    6. is_private initialized to: "0"
    7. login: "apnadkarni"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "apnadkarni"
    14. subsystem initialized to: "- New Builtin Commands"
    15. title initialized to: "glob inconsistencies on macos"
    16. type initialized to: "Bug"
  2. Ticket change [426da51a96] (rid 252411) by apnadkarni on 2026-04-01 08:20:38:

    1. icomment:
      It appears that the inconsistency between 
      
      ```
      glob /tmp/MIXEDCASE
      glob /tmp/M*
      ```
      
      occurs because matching code is case-sensitive and existence check is case-insensitive (via lstat on MacOS).
      
      My opinion, as a non-macos user is that the matching code should be changed to be case-insensitive. Though this would be a backward incompatibility, it feels more like a bug fix.
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  3. Ticket change [8d6c4f11e2] (rid 252417) by jan.nijtmans on 2026-04-01 10:44:22:

    1. assignee changed to: "apnadkarni"
    2. icomment:
      > My opinion, as a non-macos user is that the matching code should be changed to be case-insensitive. Though this would be a backward incompatibility, it feels more like a bug fix.
      
      +1
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
  4. Ticket change [444e362558] (rid 252686) by apnadkarni on 2026-04-10 05:14:31:

    1. icomment:
      The [apn-mac-case](https://core.tcl-lang.org/tcl/timeline?r=apn-mac-case) branch now contains proposed fixes for the following, related but independent, issues on MacOS.
      
      - Inconsistent returns from `glob M*` and `glob MixedCase` (original ticket)
      - `file normalize` does not return the unique name for a file (does not resolve the leaf to its on-disk name)
      - MacOS file paths should be case-insensitive
      
      There is likely to be a (not quantified) performance impact to `file normalize` on MacOS as it now has to resolve the last path component's real name (just as on Windows). Correctness prevails.
      
      Reviews, particularly from MacOS folks, would be appreciated.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  5. Ticket change [c1e14220f0] (rid 252782) by apnadkarni on 2026-04-14 17:37:52:

    1. icomment: "Fixed in [8577ad7896]."
    2. login: "apnadkarni"
    3. mimetype: "text/x-fossil-plain"
  6. Ticket change [59888b4b8b] (rid 252783) by apnadkarni on 2026-04-14 17:38:06:

    1. closedate changed to: "2461145.2347934838"
    2. closer changed to: "apnadkarni"
    3. login: "apnadkarni"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"
  7. Ticket change [4ee6c1cb26] (rid 252874) by jmroot on 2026-04-19 07:32:23:

    1. closedate changed to: "2461149.8141619675"
    2. closer changed to: "jmroot"
    3. icomment:
      As a macOS user, I think the only way to make `glob` do what the caller wants all the time is to add an explicit `-nocase` option like `string match` has. Case-sensitive matching is what globs in the shell do (even on a case-insensitive FS):
      
      % touch f1 f2 f2 Fa Fb Fc
      % ls F*
      Fa Fb Fc
      % ls f*         
      f1 f2 f3
      
      Not being able to match in that way without extra post-processing would be a definite step backwards.
      
      IMO, the behaviour when there is a file called `MixedCase` should be:
      glob M* -> MixedCase
      glob m* -> 
      glob -nocase m* -> MixedCase
      glob MIXEDCASE ->
      glob -nocase  MIXEDCASE -> MixedCase
      
      HFS+ and APFS come in two flavours, case-sensitive and case-insensitive but case-preserving. Having your main filesystem formatted as case-sensitive is much less common but certainly not unheard of. In both flavours, filenames on disk have a specific case, and I definitely agree that `file normalize` should return that.
      
    4. login: "jmroot"
    5. mimetype: "text/plain"
  8. Ticket change [7e8124a64a] (rid 252885) by apnadkarni on 2026-04-20 05:34:35:

    1. closedate changed to: "2461150.7323515392"
    2. closer changed to: "apnadkarni"
    3. icomment:
      The `-nocase` need (or equivalent fix) is not unique to macos and is logged separately as [a5ba717243]. This branch did not address that. Besides fixing the inconsistency between globbing `m*` versus `mixedcase`, it only brings macos into consistency with other Tcl platforms where glob matching is on a per-platform basis, and is based on "general user expectations". Issues related to differing case-sensitivity in file systems are known to be broken functionality.
      
      Case-sensitivity in shells on case-insensitive file systems is broken in the other direction so I'm not sure that is a good example to follow.
      
      glob was never defined to return the on-disk name. If you need that, you have to normalize. The rationale that has been expressed is very often there is no need to incur the cost of that normalization, e.g. `foreach f [glob *.bak] {file delete $f}` or something like that.
      
      But I agree a more complete solution to the file system casing is required. Hence the aforementioned ticket.
      
    4. login: "apnadkarni"
    5. mimetype: "text/x-markdown"