caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Laszlo Nemeth <laszlo@ropas.kaist.ac.kr>
To: caml-list@inria.fr
Subject: [Caml-list] Pipes in 3.01
Date: Fri, 30 Mar 2001 12:43:01 +0900 (KST)	[thread overview]
Message-ID: <200103300343.MAA04678@ropas.kaist.ac.kr> (raw)

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


             reply	other threads:[~2001-03-30  3:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-30  3:43 Laszlo Nemeth [this message]
2001-03-30 11:33 Damien Doligez
2001-03-31  2:12 ` Laszlo Nemeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200103300343.MAA04678@ropas.kaist.ac.kr \
    --to=laszlo@ropas.kaist.ac.kr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).