On Fri, Jan 23, 2009 at 02:20:41PM +0000, Dawid Toton wrote:
> Let's see the output as a sequence of bytes (there's no time).
> Assuming that the process exits normally and incompatible printing  
> functions are not mixed:
> is there a guarantee (in OCaml library) that the flush operation doesn't  
> affect the output?

The flush operation only relates to the time at which the write
occurs (i.e., flush may make it occur sooner than it would otherwise).
So if you're ignoring the time element (and error cases like writing
to a full disk or a broken pipe), it's unobservable.

But if the output is part of a larger interactive system -- prompting
a user for input, or engaging in a 2-way protocol with another process
-- then flushing can be essential for correct behavior.

-- 
Eric Cooper             e c c @ c m u . e d u

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to