Skip to content
Tcl Source Code Artifact [fd5eb38bcd]
Login

Artifact [fd5eb38bcd]

Artifact fd5eb38bcd309aa5d9cb05b55a490d3d0a8e3222:

Ticket change [fd5eb38bcd] - Ticket [931847ffffffffff|931847ffff] <i>TclFSNormalizeToUniquePath - incomplete?</i> status still Open with 4 other changes by vincentdarley on 2004-04-09 00:24:16.
D 2004-04-09T00:24:16
J icomment Logged\sIn:\sYES\s\nuser_id=32170\n\nWow,\syou've\sbeen\slooking\svery\sclosely!\n\nI\sdidn't\sdesign\sthe\scode\sto\shandle\ssymlinks\sbetween\nfilesystems,\salthough\sI\ssuppose\sI\sdidn't\sactually\sdocument\nthat\sanywhere.\s\sI\scertainly\sagree\sthat\sthat\swould\ndemonstrate\sbugs\sin\sthe\sexisting\scode.\n\nIn\sparticular,\showever,\sthe\sbasic\scode\sassumption\sis\sthat\nthe\snormalization\scan\sbe\sachieved\sby\s(i)\sasking\sthe\snative\nfilesystem\sto\snormalize,\sthen\s(ii)\sasking\seach\sother\nfilesystem\sto\snormalize\sexactly\sonce\seach.\n\nClearly\sif\sfilesystems\scan\sbe\snested\sarbitrarily\s(e.g.\nthrough\syour\ssymlink\sapproach),\sor\smore\ssimply:\n\nC:/foo/bar.zip/ZIP/foo.kit/KIT/blah.zip/ZIP\n\nAssuming\swe\shave\sa\sseparate\s.zip\sand\s.kit\sfilesystem,\seach\nof\swhich\shave\sdecided\sthey\sare\scase-insensitive\sand\sthat\sall\nnormalized\spaths\sshould\sbe\slower\scase.\s\sThen\sthe\sabove\nshould\sbe\snormalized\sfirst\sby\sthe\sOS\s(C:/foo/bar.zip)\sthen\nby\sthe\szipfs\s(/ZIP/foo.kit)\sthen\sby\sthe\skitfs\s(KIT/blah.zip)\nthen\sby\sthe\szipfs\sagain\s(ZIP).\n\nIn\sthe\scurrent\scode\sstructure\sthis\swould\snot\swork.\n\nI\sguess\sthe\scorrect\ssolution\sis\sto\sfirst\sask\sthe\snativefs,\nand\sthen,\sfor\sthe\sfilesystem\swhich\saccepts\sthe\spath\swhich\nhas\sbeen\snormalized\sso\sfar,\sask\sit\sto\snormalize\ssome\smore.\s\nWhen\sno\sfilesystem\saccepts\sthe\spath,\sthen\sjust\sstop.\s\sSo,\nwe'd\shave:\n\nOverall\spath\saccepted\sby\snative\sfs.\nC:/foo/bar.zip\s\s\snormalized\sby\snative,\sleaving\s'startAt'\sat\nfollowing\s'/'\n\nC:/foo/bar.zip/\srecognised\sby\szipfs\nC:/foo/bar.zip/zip/foo.kit\snormalized\sby\szipfs.\n\nC:/foo/bar.zip/zip/foo.kit/\srecognized\sby\skitfs\netc.\n\nSo\s(pseudo-code):\n\nwhile\s(1)\s{\n\s\s\s\sfs\s=\sPathInFilesystem(path,\sup\sto\s'startAt');\n\s\s\s\sif\s(fs\s==\snull)\sbreak;\n\s\s\s\sstartAt\s=\sfs->normalizePath(path,\sstartAt);\n}\n\nwith\sa\sbit\sof\schecking\sto\savoid\sinfinite\sloops.\n\nThis\swould\seven\ssolve\syour\ssymlink\sissue,\sI\sthink,\salthough\nI\shaven't\sthought\swhat\sit\smeans\sfor\s'dir/..'\shandling.\n\n
J login vincentdarley
J mimetype text/plain
J username vincentdarley
K 931847ffffffffffffffffffffffffffffffffff
U vincentdarley
Z 2c548086561be6f8efd7305f61dfe02a