Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Pipes in 3.01
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <Damien.Doligez@i...>
Subject: Re: [Caml-list] Pipes in 3.01
>From: Laszlo Nemeth <laszlo@ropas.kaist.ac.kr>

>        let (dIn, dOut) = Unix.pipe () in
You're creating one pipe.

>        let dProcess = Unix.create_process "daVinci"
>                                           [| "-pipe" |]
>                                           ~stdin:dIn
>                                           ~stdout:dOut
>                                           ~stderr:Unix.stderr

You're piping the output of daVinci into its own input.

>        let len = Unix.read dIn ~buf ~pos:0 100 in

You're competing with daVinci on reading its output

>On the other hand, if I start up daVinci in a shell (with
>-pipe) it immediately sends back the string ok.

I guess it does the same here, but it reads back the "ok" before you
do, then it waits for some more input.


If you want to send some input to daVinci AND get back its output, you
will need to create two pipes.

-- Damien
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr