Skip to content
Tcl Source Code Artifact [193d4f154c]
Login

Artifact [193d4f154c]

Artifact 193d4f154ca9a0232fa8faf7f5c92f7cc1c44452b0be03c341056604825378f7:

Ticket change [193d4f154c] - New ticket [eeab90542804319c|eeab905428] <i>file glob semantics - support efficient retrieval - reduce round trips</i>. by juliannoble2 on 2023-08-20 13:24:59.
D 2023-08-20T13:24:59.942
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-plain
J comment The\sfile\sglob\scommand\ssemantics\sof\sreturning\sa\ssingle\slist\sof\sresults\sdoesn't\sallow\sfor\sgathering\sother\sinformation\sthat\sshould\sbe\savailable\sin\sa\ssingle\scall\sto\sthe\sfilesystem.\r\n\r\nFor\sexample\s-\sa\ssearch/audit\sprogram\sthat\swalks\sthe\sfilesystem\smay\sreasonably\sneed\sto\sgather\sboth\ssubdirectories\sand\sfiles\sfor\seach\snode.\s\sWhilst\sglob\slets\syou\ssearch\sfor\sfiles\sand\sdirs\sat\sonce\s-\sthey\sare\snot\sdistinguished\sin\sthe\sresults.\r\n\r\nIt\sis\salso\sinefficient\sin\sthat,\sat\sleast\son\ssome\sfilesystems\s-\sother\sinformation\ssuch\sas\sfile\ssize\s(and\sattributes)\sis\savailable\sin\sthe\ssame\sAPI\scall\sthat\sgathers\sthe\sdirectory\scontents.\r\n\r\nThis\sis\sparticularly\sa\sconcern\son\swindows\s-\swhere\sthe\sinteraction\swith\sthe\sslow\s'file\sglob'/'file\sattributes'\setc\scalls\sand\smultiple\srequired\scalls\sto\sglob\sbecause\sof\scurrent\ssemantics\smake\sthe\sslow-downs\smassive.\r\n(see\sticket:\shttps://core.tcl-lang.org/tcl/tktview/411f52ed87)\r\n\r\nThe\srequest\sis\sfor\san\senhancement\sto\sfile\sglob\s-\ssomething\slike\s-dict\s?desired\skeys|all?\s\sthat\swill\sreturn\sa\sdict\scontaining\sat\sleast\sthe\skeys\sfiles\s&\sdirs\s&\slinks\sand\sideally\sa\sfilesizes\skey\swhere\sthe\svalue\sis\sthe\ssize\sof\seach\sfile\sin\sthe\ssame\sorder\sas\sreturned\sby\sthe\slist\sof\snames\sin\sfiles.\s\r\nThat\sway\sthe\scaller\scould\sprocess\susing:\s\sforeach\sfname\s[dict\sget\s$result\sfiles]\sfsize\s[dict\sget\s$result\sfilesizes]\s...\r\n\r\nOther\sfile\sor\sdirectory\sattributes\scould\shave\stheir\sown\skey\sfor\sordered\sresults.\r\nIf\sa\sparticular\splatform\scan't\sgather\sthe\sinformation\s-\san\sempty\slist\scould\sbe\sreturned\sfor\sthat\sattribute\slist,\srequiring\sthe\scaller\sto\smake\srepeated\scalls\sto\sgather\sit\sif\srequired.\r\n\r\nThe\ssemantic\sshortcomings\sof\sglob\sbecome\sapparent\swhen\sattempting\sto\simplement\sa\spure\stcl\sequivalent\sof\sthe\sunix\sdu\scommand.\r\nInitial\sattempts\sgave\sresults\saround\s20x\sworse\sthan\sexecing\sout\sto\sdu\s-\sbut\sby\susing\stwapi\son\swindows\sto\sreduce\sthe\snumber\sof\srequired\sglob\scalls\sand\sfile\ssize\scalls\s-\sthe\sperformance\sacheivable\swas\smuch\sbetter\sthan\san\sexternal\stool\sfor\ssmall\sand\smedium\ssize\strees,\sand\seven\scompetitive\sor\sbetter\son\ssome\slarger\ssystems.\s\sI\sknow\sof\sno\ssuch\soptimisation\son\sunix-like\splatforms\s-\sso\spresumably\spure\sTcl\sscript\sremains\suncompetitive\swith\sexternal\stools\sand\sother\slanguages\sfor\sa\sclass\sof\sfilesystem-walking\soperations\s-\swhen\sit\sdoesn't\sneed\sto\sbe.
J foundin Any
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 file\sglob\ssemantics\s-\s\ssupport\sefficient\sretrieval\s-\sreduce\sround\strips
J type RFE
K eeab90542804319c07ed3775926ad9791cf859ca
U juliannoble2
Z 1adc00d35bfa4586e3055fa0e739137c