Skip to content
Tcl Source Code Artifact [67b317145e]
Login

Artifact [67b317145e]

Artifact 67b317145ec6f3ebcd6204e2b67c1490ec4fc332e814dbade7011c346c159273:

Ticket change [67b317145e] - New ticket [e5c21e566ff31a51|e5c21e566f] <i>inconsistent handling of glob -nocomplain</i>. by sebres on 2025-08-13 17:02:18.
D 2025-08-13T17:02:18.253
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment It\slooks\sthat\son\scertain\scircumstances\sglob\s-nocomplain\smay\scomplain\sabout\s"no\ssuch\sfile\sor\sdirectory".\sStill\sworse\sfor\sTcl\s9,\sbecause\ssince\sTIP#637\s-glob\salways\sworks\sas\s"nocomplain"\snow.\r\n\r\nNormally,\sfollowing\scode\swould\sreturn\san\sempty\slist\sif\sthe\sdirectory\sdoesn't\sexist:\r\n<code><pre>\r\n%\sglob\s-nocomplain\s-directory\s{/path/that/does/not/exist}\s*.ext\r\n~empty~\r\n</pre></code>\r\n\r\nHowever\ssometimes\s(depending\son\sfile-system/platform/whatever)\sit\smay\sfail...\sfor\sinstance\sthis\shappens\sby\ssome\sof\smy\scustomer\son\ssome\sSMB-share\son\sWindows:\r\n<code><pre>\r\n%\sglob\s-nocomplain\s-directory\s{//server/smb-share/no-such-path}\s*.ext\r\ncouldn't\sread\sdirectory\s"//server/smb-share/no-such-path/*.ext":\sno\ssuch\sfile\sor\sdirectory\r\n</pre></code>\r\n\r\nI\scannot\sreproduce\sit\sdirectly\sin\sthis\sconstellation\son\smy\sboxes,\sbut\sI\sguess\sI\sfound\sit\sin\ssource\scode,\sand\swas\sable\sto\sreproduce\sanother\ssimilar\s"inconsistence"\s(e.\sg.\sif\sthere\sis\sno\saccess\sto\sdirectory):\r\n<code><pre>\r\n%\sglob\s-nocomplain\s-directory\s{/path-without-permissions}\s*.ext\r\ncouldn't\sread\sdirectory\s"/path-without-permissions/*.ext":\spermission\sdenied\r\n%\sglob\s-nocomplain\s-directory\s{/path-without-permissions/.}\s*.ext\r\n~empty~\r\n%\sglob\s-nocomplain\s-directory\s{/path-without-permissions/other}\s*.ext\r\n~empty~\r\n</pre></code>\r\nThe\sreason\sseems\sto\sbe\sthat\sneither\sDoGlob\snor\sTcl_FSMatchInDirectory\sknow\s\r\nTCL_GLOBMODE_NO_COMPLAIN\sflag,\sor\srather\strying\sto\sdistinguish\sthe\serror\scodes\sinternally,\s\sso\sby\sthe\serror\sthey'd\ssimply\sset\sit\sto\sthe\sinterpreter\sand\sreturn\swith\sTCL_ERROR.\r\n\r\nI'm\spretty\ssure\sthat\sfrom\spoint\sof\sview\sof\snot\scomplaining\sglob,\sboth\scodes,\sENOENT\sand\sEACCES,\sshall\sbe\sconsidered\sas\sno\shits,\sand\sglob\shas\sto\sreturn\sempty\slist\swithout\sto\scomplain\sthe\serror,\sno\smatter\show\sdeep\sexactly\sit\swas\scaused.
J foundin any
J is_private 0
J login sebres
J priority 5\sMedium
J private_contact 50e9528765c18296566374b3fde2df942c394efd
J resolution None
J severity Severe
J status Open
J submitter sebres
J subsystem 37.\sFile\sSystem
J title inconsistent\shandling\sof\sglob\s-nocomplain
J type Bug
K e5c21e566ff31a51f85bf12e0b5031993a3c4b4a
U sebres
Z ed6363ac9911d8619555c9f8a8a34052