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 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 52CA3BC69 for ; Thu, 23 Aug 2007 17:29:16 +0200 (CEST) Received: from mailgwbi1.fraunhofer.de (mailgwbi1.fraunhofer.de [192.54.34.2]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7NFTFIQ026779 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 23 Aug 2007 17:29:16 +0200 Received: from mailgwbi1.fraunhofer.de (localhost [127.0.0.1]) by mailgwbi1.fraunhofer.de (8.13.5+/8.13.5) with ESMTP id l7NFObiD003998 for ; Thu, 23 Aug 2007 17:24:38 +0200 (CEST) Received: from kso.iais.fraunhofer.de (mail-gw.iais.fraunhofer.de [193.175.162.66]) by mailgwbi1.fraunhofer.de (8.13.5+/8.13.5) with ESMTP id l7NFObru003995 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Aug 2007 17:24:37 +0200 (CEST) Received: from ksi.iais.fraunhofer.de (ksi.iais.fraunhofer.de [129.26.64.2]) by kso.iais.fraunhofer.de (8.13.5+/8.13.5) with ESMTP id l7NFObhA012687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Aug 2007 17:24:37 +0200 (CEST) X-Received: iais.fraunhofer.de-policy from ksi.iais.fraunhofer.de (localhost [127.0.0.1]) by ksi.iais.fraunhofer.de (8.13.5+/8.13.5) with ESMTP id l7NFNdix014395 for ; Thu, 23 Aug 2007 17:23:39 +0200 (CEST) Received: from [129.26.149.197] (dhcp-129-26-149-197.ais.fraunhofer.de [129.26.149.197]) by ksi.iais.fraunhofer.de (8.13.5+/8.13.5) with ESMTP id l7NFNdVI014392 for ; Thu, 23 Aug 2007 17:23:39 +0200 (CEST) X-Authentication-Warning: ksi.iais.fraunhofer.de: Host dhcp-129-26-149-197.ais.fraunhofer.de [129.26.149.197] claimed to be [129.26.149.197] Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: <28fa90930708221256t497e8356k84861abd6b2e91b8@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <02125A45-BC89-4B44-B3A2-6BCC88B6FC37@iais.fraunhofer.de> Content-Transfer-Encoding: 7bit From: =?ISO-8859-1?Q? "Dr._Axel_Poign=E9" ?= Subject: Re: [Caml-list] commands.getoutput () in ocaml? Date: Thu, 23 Aug 2007 17:24:29 +0200 To: caml-list@yquem.inria.fr X-Mailer: Apple Mail (2.752.3) x-fraunhofer-email-policy: accepted X-Miltered: at discorde with ID 46CDA7CB.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; fraunhofer:01 ocaml:01 ocaml:01 translated:01 buffer:01 sourceforge:01 caml-list:01 output:02 chapter:04 consequence:04 problem:05 problem:05 channel:06 long:06 examples:07 > > >> I am looking for a quick way to do the equivalent of >> s = commands.getoutput ("ls " + name + "*") >> in Ocaml. >> > > I have translated many of the examples from the Perl Cookbook for > the Process Management and Communication chapter of the OCaml > PLEAC. This is one of the topics covered. > > http://pleac.sourceforge.net/pleac_ocaml/processmanagementetc.html > > Dave > There is a problem with the read_process_lines function though: if the output buffer gets too long the process does not return to close the input channel. Consequence is that the spawning process is blocked. That's a problem I do not know how to solve. Axel