Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: [Caml-list] select (or polling) on in_channel?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-04-05 (13:39)
From: Eijiro Sumii <eijiro_sumii@a...>
Subject: Re: [Caml-list] select (or polling) on in_channel?
From: "sejourne kevin" <>
> 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'.

No, unfortunately, since it cannot time out when no input is
available.  Also, I have to write the network communication as a
separate process, which is more complex than using select.  My
previous messages give more details on what I'd like to do.