From: "Rolf Wester" <wester@ilt.fhg.de>
To: caml-list@pauillac.inria.fr
Subject: [Caml-list] Unix.create_process
Date: Wed, 19 Dec 2001 18:34:49 +0200 [thread overview]
Message-ID: <3C20DDC9.22969.A60E35F@localhost> (raw)
Hi,
I want to start a process and read the stdout channel of this process.
I tried:
let instring = String.create 10 in
let pid = Unix.create_process ~prog:"ls" ~args:[|"/usr"|]
~stdin:Unix.stdin ~stdout:Unix.stdin ~stderr:Unix.stderr in
let nread = Unix.read Unix.stdin ~buf:instring ~pos:0 ~len:10 in instring;;
but this one waits for keyboeard input instead of reading the output of ls.
When I type ~stdout:Unix.stdout instead of ~stdout:Unix.stdin the ls
output is written to stdout (as expected).
Can anybody tell me what I made wrong?
Thanks in advance.
Rofl Wester
-------------------------------------
Rolf Wester
rolf.wester@ilt.fraunhofer.de
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
next reply other threads:[~2001-12-20 12:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-19 16:34 Rolf Wester [this message]
2001-12-20 15:14 ` Francois Pottier
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=3C20DDC9.22969.A60E35F@localhost \
--to=wester@ilt.fhg.de \
--cc=caml-list@pauillac.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