Overview
| Artifact ID: | 5b8b36c28afd596df56ec6c1723ef90a9c3f459bac1a64904afd79c3722e9ae4 |
|---|---|
| Ticket: | 108904173c1a823a20823885c7b29ab536434a5a
glob and file normalize inconsistencies on case insensitive filesystem |
| User & Date: | juliannoble2 on 2026-03-16 04:01:05 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-plain"
- comment changed to:
Initial setup is a folder on an NTFS filesystem C:\SDX file in that folder is sdx1.bat Platform is windows 11. When globbing for that file there is a difference in the results depending on whether any glob chars are used, and the result of a 'file normalize' on a result that didn't use glob chars doesn't normalize to the case of the underlying file. % set files [glob -dir C:/SDX SDX1.bat {[S]DX1.bat} SdX1.bat*] C:/SDX/SDX1.bat C:/SDX/sdx1.bat C:/SDX/sdx1.bat %file normalize [lindex $results 0] C:/SDX/SDX1.bat I expected to get the result cased as per the filesystem. To get it to normalize to the underlying filesystem's case, taking a string range works, but other operations such as string cat don't. %file normalize [string range [lindex $results 0] 0 end] C:/SDX/sdx1.bat Due to the inability to normalize to get underlying case - I was tempted to use redundant globbing with square brackets for the case where user input had no glob chars. ie use the {[S]DX1.bat} pattern if user entered SDX1.bat. This works on windows - but then doesn't work for the same filesystem mounted on another platform: (in this case using WSL 2 on same windows machine to test - but presumably would affect a real unix-like system with NTFS filesystem mounted) %glob -dir /mnt/c/SDX SDX1.bat /mnt/c/SDX/SDX1.bat This result passes file exists test - but also isn't normalizable to get the actual underlying case - as presumably file normalize is behaving based on platform rather than attached filesystem properties. %glob -dir /mnt/c/SDX {[S]DX1.bat} (no result) I feel either neither of these should return a result or both should. I would expect either glob to always return a result that matches the actual filesystem case, or if not, for it to be normalizable without 'string' shennanigans to the underlying case. (I'd half expect 'file normalize /mnt/c/SDX/SDX1.bat' to normalize to /mnt/c/SDX/sdx1.bat on a unix platform with attached case-insensitive filesystem - but I think that assumption isn't supported in the docs. This behaviour seems like a shortcoming or perhaps a design decision) For the situation where the case-sensitive filesystem is mounted on a platform that isn't normally used with case-sensitive filesystems - I'd ideally expect it to be able to glob for patterns independent of case on that filesystem - but at the very least I wouldn't expect different results from patterns SDX1.bat vs {[S]DX1.bat} I'm not sure if this is 1 or 2 bugs. I haven't been able to fully work out from docs what the intended behaviours are. - foundin changed to: "8.6,9"
- is_private changed to: "0"
- login: "juliannoble2"
- priority changed to: "5 Medium"
- private_contact changed to: "957fdfcd8744611e3fe1f4896c7538b1d9bf47b2"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "juliannoble2"
- subsystem changed to: "37. File System"
- title changed to:
glob and file normalize inconsistencies on case sensitive filesystem
- type changed to: "Bug"