.
D 2005-08-17T15:05:30
J assignee vincentdarley
J cmimetype text/plain
J comment -------\sOriginal\sreport\sto\sActiveState\sby\sJeff\sWoods\s2005-\n08-16\s17:52\n\nActiveState\sActiveTcl\s8.4.9.0.121397\sDec\s07,\s2004\n\nplatform:\sRHEL3\son\sDell\s2650\s(Xeon\sx86-32)\n\nI\sthink\swe've\sstumbled\son\sa\srace\scondition\sin\s"file\smkdir".\n\nThe\sActiveTcl\sdocumentation\ssays\s(in\spart):\nfile\smkdir\sdir\s?dir\s...?\nCreates\seach\sdirectory\sspecified.\sFor\seach\spathname\sdir\s\nspecified,\sthis\scommand\swill\screate\sall\snon-existing\s\nparent\sdirectories\sas\swell\sas\sdir\sitself.\sIf\san\sexisting\s\ndirectory\sis\sspecified,\sthen\sno\saction\sis\staken\sand\sno\s\nerror\sis\sreturned.\sTrying\sto\soverwrite\san\sexisting\sfile\swith\s\na\sdirectory\swill\sresult\sin\san\serror.\sArguments\sare\s\nprocessed\sin\sthe\sorder\sspecified,\shalting\sat\sthe\sfirst\serror,\s\nif\sany.\n\nThe\serrorInfo\swe\sget\sis\s(lightly\sedited):\ncan't\screate\s\ndirectory\s"/some/path/to/logs/ACCT/partial/2005/0813":\s\nfile\salready\sexists\n\s\s\s\swhile\sexecuting\n"file\smkdir\s[file\sdirname\s$log]"\n\s\s\s\s(procedure\s"acctStart"\sline\s20)\n\s\s\s\sinvoked\sfrom\swithin\n"acctStart\s{$Revision:\s1.3\s$}"\n\nWe\suse\scron\sto\slaunch\stwo\sTcl\sscripts\sat\smidnight\sUTC\s\n(18:00\slocal).\sBoth\sscripts\scall\sa\sTcl\s\nprocedure\s"acctStart"\sto\slog\stheir\sexecution\sand\sany\s\nerrors\sthat\smight\soccur.\sThe\s"acctStart"\sprocedure\s\ndetermines\sthe\spath\sto\sthe\slog\sfile\sincluding\sthe\sPID\sin\s\nthe\sfilename\sand\sthe\sUTC\sdate\sin\sthe\sdirectory\spath.\sJust\s\nbefore\sopening\sthe\slog\sfile,\sit\sensures\sthe\sdirectory\s\nexists\sby\sexecuting\sthe\sfailing\scommand\sabove.\sWe've\s\nbeen\susing\sthis\stechnique\sfor\syears\sto\screate\sdirectories\s\ndynamically\sand\shaven't\shad\sa\sproblem\swith\sit\suntil\s\ntonight.\n\nAfter\sthe\serror\soccurred\sI\schecked\sand\sthe\sdirectory\s\nspecified\sin\sthe\serror\sexists\sand\scontains\sthe\slog\sfile\sof\s\nthe\sother\sprocess\sthat\sran\sat\sthe\stime\s(plus\sother\slogs\s\ncreated\sin\sthe\sinterim).\n\nI\scan\sonly\simagine\sthis\shappening\sif\s"file\smkdir"\sis\susing\s\nan\salgorithm\salong\sthe\slines\sof\s"if\sdirname\sdoesn't\sexist,\s\nthen\screate\sit"\swhen\sit\sshould\sbe\sdoing\ssomething\smore\s\nlike\s"create\sdirname;\sif\scant\screate\sand\sexisting\s!=\s\ndirectory,\sthen\serror".\s\n\n\s-------\sComments\sfrom\sJeff\sHobbs\s2005-08-16\s21:06\s\n\n\s\s\s\s\sPlease\sreport\sthis\score\sissue\sto\shttp://tcl.sf.net/.\nFWIW,\syou\scan\ssee\sthe\simplementation\sof\s'file\smkdir'\sin\s\ntcl/generic/tclFCmd.c:TclFileMakeDirsCmd.
J foundin obsolete:\s8.4.9
J priority 5\sMedium
J resolution None
J status Open
J submitter kazrak_
J subsystem 37.\sFile\sSystem
J title [file\smkdir]\srace\scondition
J type Bug
K 1262180fffffffffffffffffffffffffffffffff
U kazrak_
Z 7adc5a9b0c0eb6f45e1a65ea4cacc9ed