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: Laszlo Nemeth <laszlo@r...>
Subject: Re: [Caml-list] Pipes in 3.01
Thanks for all those (Damien, Francois, Fabrice) who replied and
pointed out my misunderstanding of IPC. Nevertheless, I did not manage
to make it work with 'create_process'. Instead, I started using
'open_process' which works wonderfully.

Thanks again. Laszlo


--- the working snippet:
module DaVinciAPI : DAVINCIAPI =
  struct
    exception DaVinciInitError
    let daVinci () =
      begin try
        let (dIn, dOut) = Unix.open_process "daVinci -pipe" 
        and buf = String.create 10 in
        let len = Unix.read (Unix.descr_of_in_channel dIn) ~buf ~pos:0 10
        in
          buf
      with Unix.Unix_error _ -> raise DaVinciInitError
  end

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