Skip to content
Tcl Source Code Artifact [a93954d90a]
Login

Artifact [a93954d90a]

Artifact a93954d90a7da403584b8beb362cc5bf0acaf6cf273aaac3227ec4438f57938e:

Ticket change [a93954d90a] - New ticket [a382a311e098c19a|a382a311e0] <i>glob on case insentitive sytems not respecting character class case</i>. by juliannoble2 on 2026-03-28 04:55:08.
D 2026-03-28T04:55:08.974
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-plain
J comment related\sbut\sI\ssuspect\sdifferent\sto\shttps://core.tcl-lang.org/tcl/tktview/108904173c\r\n\r\nAn\sexample\son\swindows\sc:/windows/system32\sfolder\s(which\sis\sone\sof\sthe\slargest\sdefault\sdirectories\son\sa\swindows\ssystem)\r\n\r\n\s\s%llength\s[glob\s{[a]*}]\r\n\s\s246\r\n\s\s%llength\s[glob\s{[A]*}]\r\n\s\s246\r\n\s\s%llength\s[glob\s{[aA]*}]\r\n\s\s246\r\n\r\nI\shave\san\salternative\scommand\sfglob\sthat\sI\simplemented\susing\stwapi\sthat\scan\sproduce\scorrect\sresults.\r\n\r\n\s\s%llength\s[fglob\s{[a]*}]\r\n\s\s118\r\n\s\s%llength\s[fglob\s{[A]*}]\r\n\s\s128\r\n\s\s%llength\s[fglob\s{[aA]*}]\r\n\s\s246\r\n\r\nI\sexpect\son\sa\scase-insensitve\ssystem\sthat\scharacters\soutside\seither\scharacter\sclasses\sor\sbraced-alternative\sglobs\sshould\sbe\scase-insensitive,\sbut\scharacter\sclasses\ssuch\sas\s[a-z]\s[A-Z]\sshould\sbe\srespect\sthe\scase\sof\sthe\sfile\sas\sstored\son\sthe\ssystem\s-\swhich\sis\sclearly\spossible\sto\sdo,\sand\sat\sleast\sin\sthe\scases\sI\stested\s-\spretty\sperformantly.\r\n\r\nAs\sa\sside\snote\s-\smy\swrapper\sis\susing\stcl\sscript\sand\stwapi\sbut\sno\sother\sc\scode\s-\sand\sis\sunderstandably\sslower\son\smany\ssimple\squeries\ssuch\sas\s*,\sit\scan\soutperform\sthe\sbuiltin\sglob\son\ssome\sof\sthe\smore\scomplex\sglob\squeries.\r\n\s\s\r\n\s\s%time\s{glob\s{[a]*}}\r\n\s\s9444\smicroseconds\sper\siteration\r\n\r\n\s\s%time\s{fglob\s{[aA]*}}\r\n\s\s3164\smicroseconds\sper\siteration\r\n\s\s%time\s{fglob\s{[a]*}}\r\n\s\s1820\smicroseconds\sper\siteration\r\n\r\nThis\ssuggests\sthat\sthere\smay\sbe\sjustification\sfor\sre-examining\sthe\smechanisms\sbeing\sused\shere\s-\salthough\sI\sdon't\sclaim\sto\sknow\sall\sthe\stradeoffs\sthat\scould\sbe\srequired\sto\spreferably\soptimise\sfor\ssimple\scases.\r\n\r\nI\swould\sexpect\smy\stcl/twapi\salternative\sto\sbe\sslower\sin\sall\scases.\r\n\r\nThe\sdifference\sis\slarge\senough\sthat\sI\sdon't\sthink\sit's\srelated\sto\sany\sside\sissues\ssuch\sas\soption\sparsing\sor\schecking\sfor\svfs\setc\s(which\sI\salso\sdo\sanyway)\r\nMy\sfglob\salso\shandles\sbraced\sexpressions\s(even\snested)\sand\sgenerates\sfairly\scomplex\sregexps\sto\spost-process\sthe\sresult\sfrom\snecessarily\sbroader\squeries\sthat\sthe\sunderlying\swindows\ssystem\saccepts\s(only\s*\sand\s?\sglobs).\r\n\r\nWhilst\sI\shaven't\sset\sup\stests\sto\sverify\smy\sfglob\ssupports\sall\spossible\svalid\sglobs\s(e.g\sprocessing\sescaped\sglob\scharacters\sin\sall\slevels\sof\snesting)\sthe\stime\sdifference\sis\sstill\sa\sbit\ssuspicious\sto\sme,\sand\sthe\ssimple\scases\sabove\sshould\sbe\sfaster\sregardless\sof\sglob\sprocessing\swhich\sI\swouldn't\sexpect\sto\sdominate.\r\n\r\nMy\stime\stests\sare\son\sa\smodern\sfast\snvme\sssd\s-\sso\sI\scan't\ssuggest\sthat\smy\sglob\svs\sfglob\stimings\sabove\sare\sindicative\sfor\sspinning\srust\ssystems,\salthough\stesting\son\sa\smapped\snetwork\sdrive\sfrom\sa\sshare\son\sa\sremote\ssystem\sthe\sfglob\sversion\swas\sstill\ssignificantly\sfaster\sthan\sglob\sfor\sthose\sbasic\scharacter-class\squeries.
J is_private 0
J login juliannoble2
J priority 5\sMedium
J private_contact 957fdfcd8744611e3fe1f4896c7538b1d9bf47b2
J resolution None
J severity Important
J status Open
J submitter juliannoble2
J subsystem 37.\sFile\sSystem
J title glob\son\scase\sinsentitive\ssytems\snot\srespecting\scharacter\sclass\scase
J type Bug
K a382a311e098c19ae3abe371602eb84d7a1e00e6
U juliannoble2
Z 6a3da989bc48b004b6a7b8d791ef7173