.
D 2003-11-21T13:13:12
J assignee dkf
J cmimetype text/plain
J comment On\sUnix-like\ssystems\swhen\screating\sa\ssymbolic\slink:\n\n\s\s\s\s\sfile\slink\s-symbolic\slink\starget\n\nand\s\sa\sdirectory\s\scomponent\s\sin\s"link"\s\sdoes\s\snot\sexist\nTCL\smay\sreturn\sthe\swrong\serror\smessage.\s\n\n\npackage\srequire\sTcl\s8.4\npackage\srequire\stcltest\s2.2\n\n::tcltest::configure\s-verbose\s"start\send\serror"\n\n::tcltest::test\sfile-link-error-1.1\s"wrong\serror\smessage"\s{\n\s\s\s\s-setup\s{\nset\slinkName\s[file\sjoin\sone\stwo]\nset\starget\sthree\n\n#\sIf\swe\sdo\snot\screate\sthe\sdirectory\sthe\swrong\serror\n#\smessage\sis\sreturned.\n#::tcltest::makeDirectory\sone\n::tcltest::makeFile\s{some\sdata}\s$target\n\s\s\s\s}\n\s\s\s\s-body\s{\ncatch\s{\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sfile\slink\s-symbolic\s$linkName\s$target\n\s\s\s\s\s\s\s\s\s\s\s\s}\serrmsg\nset\serrmsg\n\s\s\s\s}\n\s\s\s\s-result\s"I\sdon't\sknow\swhat\sto\sput\shere."\n\s\s\s\s-cleanup\s{\n::tcltest::removeFile\s$target\n::tcltest::removeDirectory\sone\n\s\s\s\s}\n}\n\nOn\s\smy\sLinux\s\ssystem\sthe\s\sInfo\sdocumentation\s\sfor\nthe\sGNU\sC\sLibrary\s\sreports\s\sthat\s\sthe\s\s\sonly\s\s"errno"\s\s\nvalues\s\sset\s\sby\s"symlink()"\s\sare:\s\sEEXIST,\s\sEROFS,\s\s\nENOSPC,\sEIO;\s\swhile\s\sthe\smanual\s\spage\s\s\sfor\s\s"symlink()"\s\s\n(which\s\s\sis\s\smarked\s\s"Linux\sProgrammer's\sManual")\slists\s\nmore\scodes\sincluding:\n\n\s\s\sENOENT\s\s\s\s\s\s\s\s\s\s\s\sA\sdirectory\scomponent\s\sin\s"newpath"\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sdoes\snot\sexist\s\sor\sis\s\sa\sdangling\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\ssymbolic\s\slink,\sor\s"oldpath"\sis\sthe\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sempty\sstring.\n\n\s\sIt\sappears\s\sthat\s"symlink()"\sreturns\sENOENT\sto\ssignal\s\nthe\nerror,\sbut\s"TclpObjLink()"\sin\s"tclUnixFile.c"\sis\ssupposed\sto\nleave\s\sthis\scode\s\sin\s"errno"\s\sonly\s\sif\sthe\s\starget\sdoes\s\snot\nexist,\s\s\shence\s\s\sthe\s\swrong\s\s\serror\s\s\smessage\s\sreturned\s\s\s\nby\n"Tcl_FileObjCmd()"\sin\s"tclCmdAH.c"\saround\sline\s1010.\n\n\s\sMaybe\sthe\salgorithm\sshould\sbe:\n\n\s\sif\s(true_if_exists(source))\nreturn\serror;\n\s\sif\s(false_if_exists(get_parent(source)))\nreturn\serror;\n\s\sif\s(false_if_exists(target))\nreturn\serror;\n\s\ssymlink(...);\n\nThe\s\schoice\s\sof\s\s\smaking\s\s"TclpObjLink()"\s\sto\s\ssignal\s\serror\nconditions\s\sthrough\s\s"errno"\s\sseems\s\s\sto\s\sbe\s\sthe\s\scause\s\s\nof\neverything.\n\n\s\sAaah...\s\sthe\sbeauty\s\sof\sfunctions\s\sthat\scan\s\sfail\s\sfor\sone\nreason\sonly...\s:)\n\ntcl_platform(byteOrder)\s=\slittleEndian\ntcl_platform(machine)\s\s\s=\si686\ntcl_platform(os)\s\s\s\s\s\s\s\s=\sLinux\ntcl_platform(osVersion)\s=\s2.4.22\ntcl_platform(platform)\s\s=\sunix\ntcl_platform(threaded)\s\s=\s1\ntcl_platform(user)\s\s\s\s\s\s=\smarco\ntcl_platform(wordSize)\s\s=\s4\n\ntcl_patchLevel\s=\s8.4.4\n\n
J foundin obsolete:\s8.4.4
J priority 5\sMedium
J resolution None
J status Open
J submitter marcomaggi
J subsystem 16.\sCommands\sA-H
J title file\slink\s-symbolic\swrong\serror\smessage
J type Bug
K 846567ffffffffffffffffffffffffffffffffff
U marcomaggi
Z cd6845d3794e889b33008b4f1dcabe97