.
D 2009-11-22T10:49:10
J assignee andreas_kupries
J cmimetype text/plain
J comment On\sa\sseekable\sr+\schannel\s(like\sa\sregular\sfile),\sread\sand\swrite\soperations\shave\sinconsistent\sinteractions\sdepending\son\sthe\skind\sof\sbuffering:\n\nSuppose\sfile\s"foo"\scontains\s"ABC":\n\n\sset\sf\s[open\sfoo\sr+]\n\sfconfigure\s$f\s-buffering\snone\s\n\sputs\s-nonewline\s$f\sZ\n\sputs\s[read\s$f]\s---->\sBC\n\nNow\sreset\sthe\sfile\sto\sABC\sand\stry\sit\sin\sbuffered\smode:\n\n\sset\sf\s[open\sfoo\sr+]\n\sfconfigure\s$f\s-buffering\sfull\s\n\sputs\s-nonewline\s$f\sZ\n\sputs\s[read\s$f]\s---->\sABC\n\nThis\sis\sinconsistent.\sBuffering\sshould\sonly\shave\seffects\son\sperformance,\snot\son\ssemantics.\n\nBeing\sconsistent\swould\simply\salways\skeeping\sthe\snotion\sof\sa\ssingle\sread/write\s"cursor"\sat\sscript\slevel,\sregardless\sof\sthe\sunderlying\sOS-level\sfile\sposition\spointer.\nNote\sthat\smaintaining\sthis\ssimple\scoupling\smeans\ssimpler\scode\sin\sthe\score,\sthe\sonly\snew\sthing\sbeing\sthat\sa\sread\soperation\scould\snow\scause\sa\sflush.\sI\shave\sno\sproblem\swith\sthis\sside-effect,\ssince\sbuffering/flushing\salways\shappens\sbehind\sthe\sscripter's\sback\sanyway\s([seek]\salready\sdoes\sit\ssometimes).\n\nThis\sbug\sis\srelated\sto,\sbut\smuch\ssimpler\sand\sspectacular\sthan,\sbug\s2176669.\nThe\sfix\sproposed\shere\swould\ssolve\sboth\ssimultaneously\sBTW.
J foundin None
J is_private 0
J priority 8
J resolution None
J status Open
J submitter ferrieux
J subsystem 25.\sChannel\sSystem
J title Inconsistent\sbuffered\sI/O
J type Bug
K 2901998fffffffffffffffffffffffffffffffff
U ferrieux
Z 4ebbf21050474772e33c7923f7ebda0f