<i>glob on UNC path requires additional slash</i> status still Open with 3 other changes
by
.
D 2026-05-31T04:40:03.190
J icomment Reversing\smyself\syet\sagain,\sI\sthink\sworks\sas\sdesigned,\sconfusing\sas\sit\smight\sbe.\r\n\r\nWhen\sglobbing\sa\scomponent\slike\s`Windows\\*`,\sthe\sglob\ssyntax\swill\streat\s`\\`\sas\sescaping\sthe\sfollowing\scharacter,\sthe\s`*`.\sSo\sit\sis\slooking\sactually\slooking\sfor\sthe\sstring\s`Windows*`\s(i.e.\s`*`\sis\sa\sliteral\scharacter\sin\sthe\spattern,\snot\sa\swildcard)\swhich\sfails.\sThe\sadditional\s`\\`\sis\sneeded\sto\sescape\sthe\s`\\`.\r\n\r\nThe\sconfusing\spart\sis\swhy\sthe\s`\\`\sin\sthe\sUNC\sleading\spart\sdoes\snot\sneed\sto\sbe\sdoubled.\sTcl\sparses\sthe\spath\sinto\sa\sfilesystem\scomponent\sand\sa\spattern.\sThe\sdriver\sfor\sthe\sowning\sfilesystem\sis\sthen\spassed\sthe\spattern.\r\n\r\nThe\sfilesystem\scomponent\sitself\sis\s**not**\streated\sas\sa\spattern.\sIn\sthe\sfollowing:\r\n\r\n```\r\nglob\s{\\\\io\\src\\tcl-cffi\\*}\r\n```\r\n\r\nThe\sfile\ssystem\scomponent\sis\sparsed\sas\s`\\\\io\\src\\`.\sThe\spattern\sis\s`tcl-cffi\\*`.\sThe\sasterisk\sthen\streated\snot\sas\sa\swildcard\sbut\san\sescaped\sliteral\scharacter\sand\sno\sfile\snames\sare\sreturned.\r\n\r\nThe\sreason\stop\slevel\swildcards\sas\sin\s`\\\\io\\src\\*`\swork\sis\sthat\sagain\sthe\sfile\ssystem\scomponent\sis\s`\\\\io\\src\\`\sand\sthe\spattern\sis\ssimply\s`*`\s(unescaped).\r\n\r\nThe\ssame\sissue\sarises\swith\ssimple\sdrive\spaths\sas\swell,\sonly\seven\smore\sconfusing\s:-)\sbecause\sof\sthe\spotential\sfor\sdrive-relative\spaths.\sThe\spath\s`C:/*`\sis\streated\sas\sfile\ssystem\s`C:/`\sand\spattern\s`*`.\sIs\sthe\spath\s`C:\\*`\sto\sbe\streated\slikewise\sor\sas\sa\svolume\srelative\spath\swith\sfile\ssystem\s`C:`\sand\san\sescaped\s`\\*`\sliteral\sasterisk?\sIt\sappears\sthe\slatter\soption\sis\schosen\sso\s`glob\s{C:\\*}`\swill\sreturn\sno\sfiles.\r\n\r\nI'm\snot\ssure\sthere\sis\sa\ssatisfactory\ssolution\sto\sall\sthis\sdue\sto\sthe\sinherent\sambiguities.\sAll\sI\scan\ssuggest\sis\sto\suse\sTcl\scanonical\s(forward\sslash)\spatterns\sas\sfar\sas\spossible.\r\n\r\nAbove\sanalysis\sis\snot\sauthoritative\s:-)\sso\sleaving\sticket\sopen.
J login apnadkarni
J mimetype text/x-markdown
K 7eb6b3a53f963364c3c6f29d7622d70ddf8dd610
U apnadkarni
Z dbf982cd576f53962952344785053da3