caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: "Sébastien Hinderer" <Sebastien.Hinderer@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Setting Pervasive's stderr to unbuffered as default?
Date: Tue, 25 Aug 2015 13:09:53 +0200	[thread overview]
Message-ID: <1440500993.3985.2.camel@e130.lan.sumadev.de> (raw)
In-Reply-To: <20150824121920.GE1536@pl-59055.rocqadm.inria.fr>

[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]

I cannot follow. Pervasives.stderr is unbuffered; however (see
pervasives.ml):

let print_endline s =
  output_string stdout s; output_char stdout '\n'; flush stdout
let print_newline () = output_char stdout '\n'; flush stdout

let prerr_endline s =
  output_string stderr s; output_char stderr '\n'; flush stderr
let prerr_newline () = output_char stderr '\n'; flush stderr

So far I know these are the only functions doing an implicit flush, and
they are doing it for both stdout and stderr.

Gerd


Am Montag, den 24.08.2015, 14:19 +0200 schrieb Sébastien Hinderer:
> Hi,
> 
> Oliver Bandel (2015/08/23 02:19 +0200):
> > Hello,
> > 
> > stderr on Unix is unbuffered by default.
> > 
> > In OCaml, all the Channels from Pervasives are buffered by default,
> > and flush-function must be used.
> > This issue is annoying me since ages...
> 
> [...]
> 
> I'd also prefer an unbuffered stderr, finding it more intuitive.
> 
> Thanks for havign mentionned that,
> Sébastien.
> 

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-08-25 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-23  0:19 Oliver Bandel
2015-08-24 12:19 ` Sébastien Hinderer
2015-08-25 11:09   ` Gerd Stolpmann [this message]
2015-08-25 11:52     ` Sébastien Hinderer
2015-08-25 12:32     ` Xavier Leroy

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=1440500993.3985.2.camel@e130.lan.sumadev.de \
    --to=info@gerd-stolpmann.de \
    --cc=Sebastien.Hinderer@inria.fr \
    --cc=caml-list@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).