module Lwt_process: sig
.. end
Process management
This modules allow you to spawn processes and communicate with them.
type
command = string * string array
A command is a program name with a list of arguments
val shell : string -> command
A command executed with "/bin/sh"
High-level functions
val exec : ?env:string array -> command -> Unix.process_status Lwt.t
exec command
execute command
and returns its exit status.
Receiving
val pread : ?env:string array -> command -> string Lwt.t
val pread_chars : ?env:string array -> command -> char Lwt_stream.t
val pread_line : ?env:string array -> command -> string Lwt.t
val pread_lines : ?env:string array -> command -> string Lwt_stream.t
Sending
val pwrite : ?env:string array -> command -> string -> unit Lwt.t
val pwrite_chars : ?env:string array -> command -> char Lwt_stream.t -> unit Lwt.t
val pwrite_line : ?env:string array -> command -> string -> unit Lwt.t
val pwrite_lines : ?env:string array -> command -> string Lwt_stream.t -> unit Lwt.t
Mapping
val pmap : ?env:string array -> command -> string -> string Lwt.t
val pmap_chars : ?env:string array ->
command -> char Lwt_stream.t -> char Lwt_stream.t
val pmap_line : ?env:string array -> command -> string -> string Lwt.t
val pmap_lines : ?env:string array ->
command -> string Lwt_stream.t -> string Lwt_stream.t
Spawning processes
class process_none : ?env:string array -> command ->
object
.. end
val open_process_none : ?env:string array -> command -> process_none
val with_process_none : ?env:string array ->
command -> (process_none -> 'a Lwt.t) -> 'a Lwt.t
class process_in : ?env:string array -> command ->
object
.. end
val open_process_in : ?env:string array -> command -> process_in
val with_process_in : ?env:string array ->
command -> (process_in -> 'a Lwt.t) -> 'a Lwt.t
class process_out : ?env:string array -> command ->
object
.. end
val open_process_out : ?env:string array -> command -> process_out
val with_process_out : ?env:string array ->
command -> (process_out -> 'a Lwt.t) -> 'a Lwt.t
class process : ?env:string array -> command ->
object
.. end
val open_process : ?env:string array -> command -> process
val with_process : ?env:string array ->
command -> (process -> 'a Lwt.t) -> 'a Lwt.t
class process_full : ?env:string array -> command ->
object
.. end
val open_process_full : ?env:string array -> command -> process_full
val with_process_full : ?env:string array ->
command -> (process_full -> 'a Lwt.t) -> 'a Lwt.t