caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Eric Cooper <ecc@cmu.edu>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] (Not) corrupt output of printf
Date: Fri, 23 Jan 2009 10:53:47 -0500	[thread overview]
Message-ID: <20090123155347.GB30153@localhost> (raw)
In-Reply-To: <4979D239.9010208@wp.pl>

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


      reply	other threads:[~2009-01-23 15:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 17:22 Corrupt " Dawid Toton
2009-01-23 11:20 ` [Caml-list] (Not) corrupt " Dawid Toton
2009-01-23 13:16   ` Richard Jones
2009-01-23 14:20     ` Dawid Toton
2009-01-23 15:53       ` Eric Cooper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090123155347.GB30153@localhost \
    --to=ecc@cmu.edu \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).