<i>File normalize is inconsistent with Windows junctions (filesystem-1.3,4)</i> status still Open with 3 other changes
by
.
D 2016-02-25T06:06:59.421
J icomment There\sis\sa\sbunch\sof\scode\sin\sthe\sexecution\spath\s[file\snormalize\s[file\sjoin\s...]]\r\nthat\sI\sfind\sdubious\sbut\sthe\sroot\scause\sof\sthis\sspecific\sbug\sis\sthe\sspecial\r\noptimization\scase\sin\sTclJoinPath\sstarting\sat\sline\s874\sin\stclPathObj.c\r\n\r\nAfter\sa\sbunch\sof\schecks\sto\sensure\scertain\scriteria\sare\smet\s(for\sexample,\r\nonly\stwo\selements\sto\sjoin),\sthe\sspecial\scase\scode\scalls\sTclNewFSPathObj\r\nto\sconstruct\sthe\sjoined\spath\sand\sreturns\sthe\sresult.\sHowever,\sas\r\nindicated\sby\sthe\scomments\sand\sreflected\sin\sthe\scode,\sTclNewFSPathObj\r\nexpects\sthe\sfirst\sargument\sto\sbe\san\s*absolute*\spath\swhich\sin\sthe\stest\r\ncase\sexample,\sit\sisn't.\sThe\sreturned\sobject's\sFsPath\sintrep\sis\sessentially\r\nmarked\sas\snot\sneeding\snormalization\s(the\sTCLPATH_NEEDNORM\sflag\sis\snot\sset)\r\nthough\sthe\scwdPtr\sfield\sis\sNOT\snormalized\sor\sabsolute.\r\n\r\nLater,\sTcl_FSGetNormalizedPath\sskips\sover\sthe\scrucial\snormalization\scode\r\nthinking\sthe\sFsPath\sintrep\sis\salready\snormalized.\sHence\sthe\swrong\sresult.\r\n\r\nOptions\sare\r\n\r\n-\sdisable\sthe\sTclJoinPath\sspecial\scase.\sI've\stested\sthat\sthis\sfixes\sboth\r\nthe\sreported\sbug\sas\swell\sas\sthe\sfailing\stest\scases.\sI\sdon't\sknow\show\r\nmuch\sof\sa\sperformance\simpact\sthis\shas\sin\sreal\slife.\sThe\stime\scommand\r\ndoes\snot\sshow\sany\sappreciable\sdifference\sfor\sthe\sfile\sjoin\sitself.\r\n\r\n-\sdisable\sthe\soptimized\scode\sonly\sfor\sWindows\ssince\sit\sappears\sthis\sbug\r\ndoes\snot\smanifest\son\sUnix.\sI'm\sactually\scurious\sas\sto\swhy\ssince\sit\sis\scommon\r\ncode.\sMy\sguess\sis\sthat\sthe\sfile\ssystem\sspecific\scall\sfor\snormalization\sdoes\r\nsomething\sdifferent\son\sUnix.\r\n\r\n-\sAdd\sa\scheck\sto\sspecial\scase\scriteria\sthat\sthe\sfirst\sargument\sis\sindeed\r\nan\sabsolute\spath.\r\n\r\nIn\saddition\sto\sfixing\sfile\sjoin\sas\sabove,\sthe\squestion\salso\sarises\swhether\r\nfile\snormalize\sshould\seven\suse\scached\sresults\sat\sall.\sIMHO\ssemantics\sof\r\nnormalize\sshould\srequire\sa\svisit\sto\sthe\sfilesystem\sat\sthe\stime\sthe\scall\r\nis\smade.\sOtherwise,\show\sdoes\sit\stake\sinto\saccount\sa\slink\screated\s(possibly\r\neven\sfrom\soutside\sthe\sprogram\sitself)\safter\sa\spath\sis\scached?\r\n\r\nFor\sthe\ssame\sreason,\sone\smight\sargue\sthat\sthe\sfile\slink\scommand\sshould\r\nincrement\sthe\sglobal\sfile\ssystem\sepoch\swhen\sa\slink\sis\screated\sto\r\ninvalidate\sall\scached\srepresentations.\sThis\sis\sexactly\sas\swhat\sis\r\ndone\swhen\senv(HOME)\schanges\sor\sfile\ssystem\smounts\sare\schanged\r\n(see\scomments\sin\stclioutil.c)
J login apnadkarni
J mimetype text/plain
K a47641a031858cceccf92c9a6da34406b35fed77
U apnadkarni
Z b5d4b531e539bde7ef5dab5670f48a86