From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA31317; Sat, 15 May 2004 19:25:23 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA31031 for ; Sat, 15 May 2004 19:25:22 +0200 (MET DST) Received: from kraid.nerim.net (smtp-106-saturday.nerim.net [62.4.16.106]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4FHPLEV022249 for ; Sat, 15 May 2004 19:25:21 +0200 Received: from localhost (karryall.dnsalias.org [62.4.18.180]) by kraid.nerim.net (Postfix) with ESMTP id 61F43418C8; Sat, 15 May 2004 19:25:19 +0200 (CEST) Date: Sat, 15 May 2004 18:21:31 +0200 (CEST) Message-Id: <20040515.182131.27957605.oandrieu@nerim.net> To: martin_jambon@emailuser.net Cc: caml-list@inria.fr Subject: Re: [Caml-list] Unix.open_process "cat" From: Olivier Andrieu In-Reply-To: References: X-Mailer: Mew version 4.0.64 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 nez-perce with ID 40A65281.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 andrieu:01 andrieu:01 2004:99 command:98 olivier:02 olivier:02 unix:02 unix:02 jambon:02 external:03 sed:03 pair:04 output:05 channel:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Martin Jambon [Sat, 15 May 2004]: > Hello, > > I would like to apply some external filters (e.g. cat, grep, sed, ...) > that will terminate successfully only if they reach an > end-of-file. For this I would like to use Unix.open_process, but I need to > close the output first (= the input of the command). > Is it legal to use close_out on the out_channel returned by > Unix.open_process, and later use Unix.close_process on the pair of > channels? Yes, Unix.close_process will call close_out on the channel again but this is safe. -- Olivier ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners