From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id D31FABBFB for ; Mon, 20 Jun 2005 22:08:30 +0200 (CEST) Received: from salt.cs.brown.edu (salt.cs.brown.edu [128.148.32.122]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5KK8U2g000661 for ; Mon, 20 Jun 2005 22:08:30 +0200 Received: from localhost (localhost [127.0.0.1]) by salt.cs.brown.edu (Postfix) with ESMTP id 0EAB238646E for ; Mon, 20 Jun 2005 16:08:30 -0400 (EDT) Received: from salt.cs.brown.edu ([127.0.0.1]) by localhost (salt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31413-08 for ; Mon, 20 Jun 2005 16:08:29 -0400 (EDT) Received: from null.cs.brown.edu (null.cs.brown.edu [128.148.38.190]) by salt.cs.brown.edu (Postfix) with ESMTP id E8B6E38642F for ; Mon, 20 Jun 2005 16:08:29 -0400 (EDT) Received: from point.cs.brown.edu (point [128.148.33.31]) by null.cs.brown.edu (Postfix) with ESMTP id DCFEF148010 for ; Mon, 20 Jun 2005 16:08:29 -0400 (EDT) Received: by point.cs.brown.edu (Postfix, from userid 30102) id D52357DE4; Mon, 20 Jun 2005 16:08:29 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by point.cs.brown.edu (Postfix) with ESMTP id D3C2D454A4 for ; Mon, 20 Jun 2005 16:08:29 -0400 (EDT) Date: Mon, 20 Jun 2005 16:08:29 -0400 (EDT) From: "Nathaniel J. Gaylinn" X-X-Sender: ngaylinn@point To: caml-list@yquem.inria.fr Subject: OCaml IDE (OCaml and stdout/stderr) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at cs.brown.edu X-Miltered: at nez-perce with ID 42B7223E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 stdout:01 stderr:01 stdout:01 stderr:01 ocaml's:01 abstraction:01 buffering:01 ocaml's:01 buffered:01 buffering:01 data:02 output:02 output:02 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: My program is having a hard time coping with how OCaml splits its output between stdout and stderr. The order in which a line of output is received from OCaml's stdout and a warning from its stderr seems to be completely random and therefore my program's output is also random. I'm pretty sure this has to do with how OCaml buffers stdout, but I'm not sure how to change this. To make my program more portable, I'm writing it using the QT toolkit which has a nice abstraction of inter-process communication in a class called QProcess. This is what I'm using to communicate with OCaml. >>From your experience, do you think the buffering is taking place on OCaml's end or on Qt's? Some research seems to suggest that how output is buffered from a program can be controlled from within that program (since there is direct access to the various output streams) but not from outside. If that's true, then the buffering problem must be inside OCaml. Is there any nice way to force OCaml to flush its output buffers more often? Is there any way to customize what data OCaml sends to stdout and what it sends to stderr (this would be a nice feature to have!)? Do any other ideas come to mind? Thanks, -- Nate Gaylinn