From: Lars H. <Lar...@re...> - 2010-02-10 11:07:35
|
Alexandre Ferrieux skrev: > Indeed, Tcl's nonblocking write is a high-level tool that lets the > programmer "fire and forget" about what he's just written. In > contrast, C-level nonblocking writes just report the number of bytes > actually written, letting the caller resubmit the unwritten part later > if he sees fit. Currently, Tcl always "sees fit", and does so in > background with a hidden [fileevent writable]. > > This implies that it is currently impossible at script level to > emulate the lower-level short write semantics. I do know of cases > where it matters: I've been forced to do that in C :/ > > Now, the second of Wayne's proposals, slightly extended, does the job: > > set discarded [chan clear $ch] Would that make $discarded the number of bytes that were discarded, or the actual material (bytearray) that was discarded? Lars Hellström |