caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <Damien.Doligez@inria.fr>
To: caml-list@inria.fr, laszlo@ropas.kaist.ac.kr
Subject: Re:  [Caml-list] Pipes in 3.01
Date: Fri, 30 Mar 2001 13:33:53 +0200 (MET DST)	[thread overview]
Message-ID: <200103301133.NAA0000003563@beaune.inria.fr> (raw)

>From: Laszlo Nemeth <laszlo@ropas.kaist.ac.kr>

>        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 = Unix.read 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 caml-list-request@inria.fr.  Archives: http://caml.inria.fr


             reply	other threads:[~2001-03-30 11:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-30 11:33 Damien Doligez [this message]
2001-03-31  2:12 ` Laszlo Nemeth
  -- strict thread matches above, loose matches on Subject: below --
2001-03-30  3:43 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=200103301133.NAA0000003563@beaune.inria.fr \
    --to=damien.doligez@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=laszlo@ropas.kaist.ac.kr \
    /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).