This module allows you to spawn processes and communicate with them.
A command. The first field is the name of the executable and the second is the list of arguments. For example:
("ls", [|"ls"; "-l"|])
- if the name is the empty string, then the first argument will be used (for backward compatibility with
- It is not possible to ``inline'' an argument, i.e. split it into multiple arguments with "\000". (like under
val shell : string -> command
A command executed with the shell. (with
"/bin/sh -c <cmd>" on Unix and
"cmd.exe /c <cmd>" on Windows).
All the following functions take an optional argument
timeout. If specified, after expiration, the process will be sent a
Unix.sigkill signal and channels will be closed.
type redirection = [
The file descriptor is left unchanged*)
Connect the file descriptor to
It's now the same as `Dev_null*)
The file descriptor is replaced by the given one*)
The file descriptor is replaced by the given one, which is then closed.*)
A file descriptor redirection. It describes how standard file descriptors are redirected in the child process.
Note: all optional redirection arguments default to
val exec : ?timeout:float -> ?uid:int -> ?gid:int -> ?env:string array -> ?cwd:string -> ?stdin:redirection -> ?stdout:redirection -> ?stderr:redirection -> command -> Unix.process_status Lwt.t
Executes the given command and returns its exit status.
Unix.WSTOPPED is not supported by libuv at the moment. It will return either
type state =
The process is still running*)
The process has exited*)
State of a sub-process