caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: sejourne kevin <sejourne_kevin@yahoo.fr>
To: caml-list@inria.fr
Cc: sumii@saul.cis.upenn.edu
Subject: Re: [Caml-list] select (or polling) on in_channel?
Date: Tue, 5 Apr 2005 09:00:28 +0200 (CEST)	[thread overview]
Message-ID: <20050405070028.43956.qmail@web41905.mail.yahoo.com> (raw)
In-Reply-To: 6667

 --- Eijiro Sumii <eijiro_sumii@anet.ne.jp> 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" <eijiro_sumii@anet.ne.jp>
> > 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/


             reply	other threads:[~2005-04-05  7:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-05  7:00 sejourne kevin [this message]
2005-04-05 13:39 ` Eijiro Sumii
  -- strict thread matches above, loose matches on Subject: below --
2005-03-31 23:28 Eijiro Sumii
2005-04-01 10:59 ` [Caml-list] " Gerd Stolpmann
2005-04-01 13:37   ` Eijiro Sumii
2005-04-03 14:43 ` Christoph Bauer
2005-04-04 20:24   ` Eijiro Sumii
2005-04-04 21:29     ` Eijiro Sumii
2005-04-05  5:49     ` Alex Baretta
2005-04-05 13:34       ` Eijiro Sumii
2005-04-05 14:14         ` Alex Baretta
2005-04-05 18:07           ` Eijiro Sumii
2005-04-05 14:30         ` Richard Jones
2005-04-05 18:12           ` Eijiro Sumii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050405070028.43956.qmail@web41905.mail.yahoo.com \
    --to=sejourne_kevin@yahoo.fr \
    --cc=caml-list@inria.fr \
    --cc=sumii@saul.cis.upenn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).