Skip to content
Tcl Source Code Artifact [f28f5cf99d]
Login

Artifact [f28f5cf99d]

Artifact f28f5cf99dd200e58aa7c40c9829d01b75c04f2e:

Ticket change [f28f5cf99d] - Ticket [1157137fffffffff|1157137fff] <i>Cannot open file if parent directory unreadable on Solaris</i> status still Open with 4 other changes by nobody on 2005-04-13 07:22:27.
D 2005-04-13T07:22:27
J icomment Logged\sIn:\sNO\s\n\nHi\sVince,\n\nSorry\sfor\sthe\sslow\sresponse\s-\sI\shave\sbeen\saway\sfor\sa\sfew\s\nweeks.\n\nI\shave\sdone\squite\sa\sbit\sof\sdebugging,\sand\sthe\sproblem\soccurs\s\nbecause\sTCL\sappears\sto\sbe\smaking\sthe\sassumption\sthat\s\ngetcwd()\swill\sALWAYS\ssucceed\sif\sthe\scurrent\sdirectory\s\nexists.\sThis\sseems\sto\sbe\strue\son\sLinux,\sbut\sit\sis\sNOT\strue\son\s\nother\sUnices.\sStrictly,\son\sUnix\syou\scan\sCD\sto\sa\sdirectory\sas\s\nlong\sas\syou\shave\sEXECUTE\saccess\sto\sit\s-\syou\sdo\sNOT\sneed\s\nread\saccess.\sHowever\sto\sread\sthe\sdirectory\s(eg:\sdo\san\s"ls",\sor\s\ncall\sreaddir()),\syou\sneed\sREAD\saccess\sto\sit.\n\nUnder\ssome\sUnices,\sgetcwd()\sworks\sby\srecursively\sreading\s\nthe\sdirectory\stree\sfrom\sthe\scurrent\sdirectory\sback\sup\sto\sroot,\s\nfinding\sthe\sname\sof\sthe\sdirectory\sat\seach\slevel.\sIn\sorder\sto\sdo\s\nthis,\syou\sneed\sREAD\saccess\sto\severy\sdirectory\sin\sthe\schain.\n\nWhen\sTCL\sopens\sa\sfile\sin\sTcl_FSOpenFileChannel(),\sit\sfirst\s\ncalls\sTcl_FSGetNormalizedPath()\s(in\sgeneric/tclIOUtil.c).\sIf\s\nthe\sfile\sname\sprovided\sis\sTCL_PATH_RELATIVE\sthis\scalls\s\nTcl_FSGetCwd()\s(a\sfew\slines\sbelow\sthe\scomment\s"We\shave\sto\s\nbe\sa\slittle\sbit\scareful\shere\sto\savoid\sinfinite\sloops").\sOn\sUnices\s\nwhere\sgetcwd()\sfails\sbecause\sit\scannot\sread\sone\sof\sthe\sparent\s\ndirectories,\sTcl_FSGetCwd()\sreturns\sNULL,\scausing\s\nTcl_FSGetNormalizedPath()\sto\salso\sreturn\sNULL,\sin\sturn\s\ncausing\sTcl_FSOpenFileChannel()\sto\sreturn\sNULL.\n\nThus\sthe\sfile\sopen\sfails\seven\sthough\sthe\sfile\sis\sactually\s\nreadable,\ssimply\sbecuase\sTCL\sseems\sto\salways\swant\sthe\s\nfilename\sas\sa\sfull\spathname.\sThis\sappears\sto\sbe\sa\sdesign\sflaw\s\nin\sTCL.\sIt\s*should*\sbe\sable\sto\sopen\sa\sreadable\sfile\seven\sif\s\ngetcwd()\sfails\s-\sjust\slike\sany\sother\sprogramming\slanguage.\n\nBest\sregards,\nMike\sSelig\s([email protected])\n
J login nobody
J mimetype text/plain
J username nobody
K 1157137fffffffffffffffffffffffffffffffff
U nobody
Z dd46d087a9cb6914221dbc2e42b66793