From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 0481FBC48 for ; Tue, 5 Apr 2005 09:00:31 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j3570UIH019373 for ; Tue, 5 Apr 2005 09:00:30 +0200 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 JAA20702 for ; Tue, 5 Apr 2005 09:00:30 +0200 (MET DST) Received: from web41905.mail.yahoo.com (web41905.mail.yahoo.com [66.218.93.156]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id j3570S45015267 for ; Tue, 5 Apr 2005 09:00:29 +0200 Received: (qmail 43958 invoked by uid 60001); 5 Apr 2005 07:00:28 -0000 Message-ID: <20050405070028.43956.qmail@web41905.mail.yahoo.com> Received: from [129.175.157.10] by web41905.mail.yahoo.com via HTTP; Tue, 05 Apr 2005 09:00:28 CEST Date: Tue, 5 Apr 2005 09:00:28 +0200 (CEST) From: sejourne kevin Subject: Re: [Caml-list] select (or polling) on in_channel? To: caml-list@inria.fr Cc: sumii@saul.cis.upenn.edu In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 4252378E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4252378C.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 eijiro:01 sumii:01 eijiro:01 sumii:01 ocaml:01 pervasives:01 low-level:01 high-level:01 evry:01 ocaml:01 ...:98 unix:01 unix:01 bin:01 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: --- Eijiro Sumii a écrit : > P.S. I've also received an e-mail informing me that > Cash > > http://pauillac.inria.fr/cash/latest/doc/Cash.html > > has such a function. It looks nice, but having it > in pure/core OCaml > would be even nicer. > > From: "Eijiro Sumii" > > Thanks to everyone for ideas on how to "select" > Pervasives.in_channel. > > Since there seems to be no better solution than > > > > (1) hacking the low-level structure by using > external C, or > > > > (2) reinventing the high-level library on top of > Unix I/O, > > > > I'm thinking of submitting a feature wish at > > http://pauillac.inria.fr/bin/caml-bugs. It should > be easy enough for > > the developers to implement, I hope... (I could > contribute my own > > implementation if necessary, but I'm sure they > will do better work.) I'not sure of what you want, but does this do the job? let système command f_line = let cin = Unix.open_process_in command in (try while true do f_line (input_line cin); done with | End_of_file -> ()); Unix.close_process_in cin ;; It is just a function that give to 'f_line' evry lines produced by a pipe by the 'command'. I use it for Xdialog2Ocaml Kevin. __________________________________________________________________ Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/