From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id FAA21735; Fri, 30 Mar 2001 05:43:38 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id FAA21743 for ; Fri, 30 Mar 2001 05:43:37 +0200 (MET DST) Received: from ropas.kaist.ac.kr (ropas.kaist.ac.kr [143.248.92.105]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f2U3h5909644 for ; Fri, 30 Mar 2001 05:43:05 +0200 (MET DST) Received: (from laszlo@localhost) by ropas.kaist.ac.kr (8.9.3/8.9.3) id MAA04678; Fri, 30 Mar 2001 12:43:01 +0900 (KST) Date: Fri, 30 Mar 2001 12:43:01 +0900 (KST) Message-Id: <200103300343.MAA04678@ropas.kaist.ac.kr> X-Authentication-Warning: ropas.kaist.ac.kr: laszlo set sender to laszlo@ropas.kaist.ac.kr using -f From: Laszlo Nemeth To: caml-list@inria.fr Subject: [Caml-list] Pipes in 3.01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, I'm trying to implement an api for daVinci (my first ocaml program!) and pipes don't seem to work: module DaVinciAPI : DAVINCIAPI = struct exception DaVinciInitError let daVinci () = begin try let (dIn, dOut) = Unix.pipe () in let dProcess = Unix.create_process "daVinci" [| "-pipe" |] ~stdin:dIn ~stdout:dOut ~stderr:Unix.stderr and buf = String.create 100 in let len = Unix.read dIn ~buf ~pos:0 100 in if len > 0 then () else raise DaVinciInitError with Unix.Unix_error _ -> raise DaVinciInitError end; 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 perfectly). 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 caml-list-request@inria.fr. Archives: http://caml.inria.fr