.
D 2003-02-04T11:52:30
J assignee andreas_kupries
J cmimetype text/plain
J comment There\sis\sa\sdifference\sbetween\sthe\sfollowing\stwo\nscripts:\n\s\s\s\s#!/usr/local/bin/tclsh8.4\n\s\s\s\sforeach\si\s{\s0\s1\s2\s3\s4\s5\s6\s7\s8\s9\s}\s{\n\s\s\s\s\s\s\s\sputs\s[open\s"/tmp/test.out2"\s"a"]\s$i\n\s\s\s\s}\nand\n\s\s\s\s#!/usr/local/bin/tclsh8.4\n\s\s\s\sforeach\si\s{\s0\s1\s2\s3\s4\s5\s6\s7\s8\s9\s}\s{\n\s\s\s\s\s\s\s\sputs\s[open\s"/tmp/test.out2"\s{WRONLY\sCREAT\nAPPEND}]\s$i\n\s\s\s\s}\n\nIn\sthe\sfirst\scase,\sonly\sa\ssingle\svalue\s("0")\sappears\sin\nthe\sfile\sonce\sthe\sscript\shas\srun,\sbut\sin\sthe\ssecond\ncase,\sall\svalues\swritten\sto\sthe\sfile\sappear\sin\sit.\s\nThis\sdifference\sin\sbehaviour\sbetween\sthe\s"a"\smode\sand\nthe\sgiven\sset\sof\soptions\sis\shighly\ssurprising\sto\sme,\nand\sa\sproblem\ssince\smany\spieces\sof\scode\sthat\sadd\ninformation\sto\slog\sfiles\smay\swell\sbe\susing\sit\sassuming\nthat\sthe\slatter\sbehaviour\swill\shappen.\s\sThis\scould\slead\nto\sinformation\sloss\swhen\sseveral\sprocesses\sappend\sto\nthe\ssame\slog\sfile,\swhich\sis\svery\sserious\sand\sfairly\ntricky\sto\sreproduce\sreliably.\sShould\sthe\sbehaviour\sof\n"a"\s(and\spossibly\s"a+"?)\sbe\saltered\sso\sas\sto\suse\sthe\nAPPEND\sflag\sinternally,\sinstead\sof\sa\ssingle\sseek\swhen\nthe\sfile\sis\sopened\s(which\smust\sbe\swhat\shappens\sat\sthe\nmoment.)
J foundin obsolete:\s8.4.1
J priority 9\sImmediate
J resolution None
J status Open
J submitter dkf
J subsystem 24.\sChannel\sCommands
J title Multi-append\sfile\ssurprise
J type Bug
K 680143ffffffffffffffffffffffffffffffffff
U dkf
Z f9026ff6d6c23c0bf70ff9a575c83622