From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 908AEBC48 for ; Wed, 6 Apr 2005 12:46:49 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j36AkmpO007239 for ; Wed, 6 Apr 2005 12:46:49 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA25447 for ; Wed, 6 Apr 2005 12:46:48 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j36Akkjs007234 for ; Wed, 6 Apr 2005 12:46:47 +0200 Received: from localhost (suiren [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.13.1/8.13.1) with ESMTP id j36AkhAG010911; Wed, 6 Apr 2005 19:46:44 +0900 (JST) Date: Wed, 06 Apr 2005 19:46:34 +0900 (JST) Message-Id: <20050406.194634.00976783.garrigue@math.nagoya-u.ac.jp> To: roessler@rftp.com Cc: caml-list@inria.fr Subject: Re: [Caml-list] Toplevel usage of stdout and stderr From: Jacques Garrigue In-Reply-To: <4253A8E0.8090802@rftp.com> References: <4253A8E0.8090802@rftp.com> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4253BE18.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4253BE16.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 toplevel:01 stdout:01 stderr:01 toplevel:01 ocaml:01 stdout:01 stderr:01 ocaml:01 surprising:01 prerr:01 buffering:01 iirc:01 subprocess:01 subprocess:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: From: Robert Roessler > I am close to finishing my LablGTK-based syntax-colored GUI for the > toplevel... and I have noticed [the Windows version of] the ocaml > toplevel seems to use both stdout and stderr for warnings and errors. > > Chapter 9 of the Objective Caml manual clearly states "results are > printed on standard output, errors on standard error" and further that > the Windows ocaml.exe "works exactly as under Unix". Sometimes even developers don't read the manual. I was convinced that in interactive mode errors go to stdout. I even remember some discussions about this. In practice it seems that errors go to stdout, but warnings go to stderr. Not surprising as prerr_warning takes no parameter and prints (almost) directly to stderr. Sorry for this confusing situation. On Unix this is not too bad, but on windows the buffering can be a pain IIRC. If you are calling ocaml as a subprocess, ocamlbrowser provides a way to do it, and even to kill the subprocess. Look in shell.ml. This is rather mixed with Tk parts. The point is that on windows Fileinput did not work on pipes, so an alternative system is coded using threads. Jacques Garrigue