module Sync:sig
..end
The functions below all return means to control the child process
and (i. e. a wait
/kill
pair).
The wait
synchronous channel returns the child status
after termination, plus lists of lines.
Input to the forked command also is a list of lines.
Depending on the function input may be absent,
as output or error can also be (then replaced by empty lists []
).
typetext =
string list
type
result = {
|
st : |
(* | Child status | *) |
|
out : |
(* | Standard output of child | *) |
|
err : |
(* | Standard error of child | *) |
type
t = {
|
wait : |
(* | Get result (will block) | *) |
|
kill : |
(* | Kill child | *) |
|
gkill : |
(* | Kill child group | *) |
val command : string -> string array -> t
JoinProc.command
.
Standard channels stdin, stdout, and stderr are the ones
of the parent process.
Accordingly, the out
and err
lists are empty.val open_in : string -> string array -> t
val open_in_out : string -> string array -> text -> t
JoinProc.open_in_out
.
The child process reads it standard input from third argument.
Standard output of child process is the out
list.val open_full : string -> string array -> text -> t
JoinProc.open_full
.
Input of child is read from third argument, while standard output
and error are the out
and err
lists.