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
[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: Laszlo Nemeth <laszlo@r...>
Subject: [Caml-list] Pipes in 3.01

I'm trying to implement an api for daVinci (my first ocaml program!)
and pipes don't seem to work:

module DaVinciAPI : DAVINCIAPI =
    exception DaVinciInitError
    let daVinci () =
      begin try
        let (dIn, dOut) = Unix.pipe () in
        let dProcess = Unix.create_process "daVinci"
                                           [| "-pipe" |]
        and buf = String.create 100 in
        let len = dIn ~buf ~pos:0 100 in
        if len > 0 then () else raise DaVinciInitError
      with Unix.Unix_error _ -> raise DaVinciInitError

The application starts up nicely, but I can't communicate with it. The
read blocks. On the other hand, if I start up daVinci in a shell (with
-pipe) it immediately sends back the string ok. I also tried to write
to the pipe, but to no avail (while doing the same from a shell works

Sorry for the probably trivial question but I haven't been able to
find (the new examples) examples of programming with pipes. 

Any help, hints, pointers are appreciated.

Thanks, Laszlo

PS. I'm using the interactive environment (after linking in the unix
library) under Solaris.
To unsubscribe, mail  Archives: