RE: Endangered I/O operations

Simon Marlow
writes: ....
You obtain the ordering properties by setting the handle to NoBuffering, otherwise you get buffered input/output. Wouldn't it be deviating from the report to do extra flushing in the buffered case?
The report is very silent about this, so I guess that reduces the question to what the end-user would prefer, (a) go non-buffered or make sure you call hFlush at the right time, or (b) have the IO implementation flush when required. I prefer (b), which is why I implemented this at the time, as it is more useable (and more efficient to boot).
FWIW, notice that stdio implementations diverge on this issue too, all Win32 impls I've seen does the flushing for you, as did earlier impls of glibc, I seem to recall.
Ok, the concensus seems to be that folk would prefer the flushing to be done automatically. There's bound to be some overhead, though... Cheers, Simon
participants (1)
-
Simon Marlow