module JoinProc:sig
..end
All functions provided by this module
fork commands given in the style
of the Unix.execvp
function.
That is, a command is a program name plus an array
of command line arguments and the program name is searched
in path.
See also Unix.execvp
.
The functions of module JoinProc
are to be used in place of
the homonymous ones of module Unix
, which are not thread safe.
val command : string -> string array -> int
command prog args
executes program prog
with arguments args
in a child process.
Standard channels stdin, stdout, and stderr are the ones
of the parent processval open_in : string -> string array -> int * in_channel
JoinProc.command
above, except that the forked process
standard output is redirected to a pipe, which can be read
via the returned input channel.val open_out : string -> string array -> int * out_channel
JoinProc.command
above, except that the forked process
standard input is redirected to a pipe, which can be written to
via the returned output channel.val open_in_out : string ->
string array -> int * (in_channel * out_channel)
pid,(outch,inch)
, where outch
is for reading the forked
command standard output, and inch
is for writing the forked command
standard inputval open_full : string ->
string array ->
int *
(in_channel * out_channel * in_channel)
pid,(outch,inch,errch)
, where outch
and errch
permit reading
the forked command standard output and standard error respectively,
while inch
permits writing on the forked command standard input.