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.5 required=5.0 tests=AWL,HTML_10_20,HTML_MESSAGE 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 05071BC69 for ; Wed, 22 Aug 2007 21:56:38 +0200 (CEST) Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.178]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7MJuXnG018773 for ; Wed, 22 Aug 2007 21:56:36 +0200 Received: by el-out-1112.google.com with SMTP id n30so67938elf for ; Wed, 22 Aug 2007 12:56:32 -0700 (PDT) Received: by 10.142.240.9 with SMTP id n9mr138933wfh.1187812591469; Wed, 22 Aug 2007 12:56:31 -0700 (PDT) Received: by 10.142.80.4 with HTTP; Wed, 22 Aug 2007 12:56:31 -0700 (PDT) Message-ID: <28fa90930708221256t497e8356k84861abd6b2e91b8@mail.gmail.com> Date: Wed, 22 Aug 2007 12:56:31 -0700 From: "Luca de Alfaro" To: caml-list@yquem.inria.fr Subject: commands.getoutput () in ocaml? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_156003_7204673.1187812591464" X-Miltered: at discorde with ID 46CC94F1.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 succint:01 succint:01 unix:01 unix:01 output:02 output:02 luca:04 luca:04 pipes:04 pipes:04 tmp:05 tmp:05 equivalent:09 ------=_Part_156003_7204673.1187812591464 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Dear All, I am looking for a quick way to do the equivalent of s = commands.getoutput ("ls " + name + "*") in Ocaml. Unix.system does perform a call, but the output of the call is not returned... yes, I can redirect it to /tmp/output.ocaml and then read the file, or even go crazy and build pipes, but is there a more elegant (read: succint) way to do it? Luca ------=_Part_156003_7204673.1187812591464 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Dear All,

I am looking for a quick way to do the equivalent of

s = commands.getoutput ("ls " + name + "*")

in Ocaml.

Unix.system does perform a call, but the output of the call is not returned... yes, I can redirect it to /tmp/output.ocaml and then read the file, or even go crazy and build pipes, but is there a more elegant (read: succint) way to do it?

Luca

------=_Part_156003_7204673.1187812591464--