From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 5D398BBB8 for ; Fri, 30 May 2008 00:16:24 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8BAHfIPkjC2fJXb2dsb2JhbACJWIhSAQwFAgYFEwOdbA X-IronPort-AV: E=Sophos;i="4.27,563,1204498800"; d="scan'208";a="12930552" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 May 2008 00:16:24 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m4TMGNC1002662 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 30 May 2008 00:16:24 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8BAHfIPkjC2fJXb2dsb2JhbACJWIhSAQwFAgYFEwOdbA X-IronPort-AV: E=Sophos;i="4.27,563,1204498800"; d="scan'208";a="12930550" Received: from anchor-post-37.mail.demon.net ([194.217.242.87]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 May 2008 00:16:23 +0200 Received: from orion.metastack.com ([80.177.38.218]) by anchor-post-37.mail.demon.net with esmtp (Exim 4.68) id 1K1qQ3-0006ul-Mn for caml-list@inria.fr; Thu, 29 May 2008 22:16:23 +0000 Received: from countertenor (cpc1-cmbg6-0-0-cust264.cmbg.cable.ntl.com [81.101.137.9]) (authenticated bits=0) by orion.metastack.com (8.13.4/8.13.3) with ESMTP id m4TM8YJA007746 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Thu, 29 May 2008 23:08:34 +0100 From: "David Allsopp" To: References: <3C72DA5E-36A7-411B-AFFA-EE26DA74D9B5@coherentgraphics.co.uk> Subject: RE: [Caml-list] Pipes and Standard Output / Input on Windows Date: Thu, 29 May 2008 23:16:14 +0100 Organization: MetaStack Solutions Ltd. Message-ID: <4D2EE0C3B4C04F74A93D13E5462F6E2A@countertenor> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcjBkE9NDTOfAvllQKak93bzY6/3GAASKq8g In-Reply-To: <3C72DA5E-36A7-411B-AFFA-EE26DA74D9B5@coherentgraphics.co.uk> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-Scanned-By: MIMEDefang 2.63 on 172.16.28.218 X-Miltered: at discorde with ID 483F2B37.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; stdin:01 stdout:01 ocaml:01 stdin:01 stdout:01 stderr:01 ocaml's:01 caml-list:01 bin:01 bin:01 variant:02 data:02 binary:02 binary:02 output:02 > All the open_in and open_out calls are using the _bin variant. The > data being sent down the pipe is a PDF file (which contains binary > sections). Why is open_in_bin needed to access stdin and stdout? I've personally had no problems chaining processes in OCaml under Windows (and the particular chaining is the control program for a Win32 Service so it's a long-lived process chain) though I did need to use set_binary_mode_in and set_binary_mode_out on stdin, stdout and stderr to disable OCaml's \r\n masking but I think that was for an application-specific reason rather than because something didn't work with the pipes. David