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] 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: 2001-03-30 (11:33)
From: Damien Doligez <Damien.Doligez@i...>
Subject: Re: [Caml-list] Pipes in 3.01
>From: Laszlo Nemeth <>

>        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 = 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  Archives: