Module Shexp_process__.Env

Runtime environment

If we were to compile a script to an OCaml program, all functions would have to take this environment as argument.

type t
module Working_dir_spec : sig ... end
val create : ?stdin:Shexp_process__.Import.Unix.file_descr ‑> ?stdout:Shexp_process__.Import.Unix.file_descr ‑> ?stderr:Shexp_process__.Import.Unix.file_descr ‑> ?cwd:Working_dir_spec.t ‑> ?unix_env:(string * string) list ‑> unit ‑> t
val add_cwd_ref : t ‑> unit

Increment the reference of the working directory

val deref_cwd : t ‑> unit

Decrement the reference of the working directory

val get_env : t ‑> string ‑> string option

Unix environment

val set_env : t ‑> string ‑> string ‑> t
val unset_env : t ‑> string ‑> t
val set_env_many : t ‑> (string * string) list ‑> t
val unset_env_many : t ‑> string list ‑> t
val cwd_logical : t ‑> string
val chdir : t ‑> string ‑> t
val stdin : t ‑> Shexp_process__.Import.Unix.file_descr
val stdout : t ‑> Shexp_process__.Import.Unix.file_descr
val stderr : t ‑> Shexp_process__.Import.Unix.file_descr
val set_stdin : t ‑> Shexp_process__.Import.Unix.file_descr ‑> t
val set_stdout : t ‑> Shexp_process__.Import.Unix.file_descr ‑> t
val set_stderr : t ‑> Shexp_process__.Import.Unix.file_descr ‑> t
val set_outputs : t ‑> Shexp_process__.Import.Unix.file_descr ‑> t
val set_stdios : t ‑> stdin:Shexp_process__.Import.Unix.file_descr ‑> stdout:Shexp_process__.Import.Unix.file_descr ‑> stderr:Shexp_process__.Import.Unix.file_descr ‑> t
val get_stdio : t ‑> Shexp_process.Std_io.t ‑> Shexp_process__.Import.Unix.file_descr
val set_stdio : t ‑> Shexp_process.Std_io.t ‑> Shexp_process__.Import.Unix.file_descr ‑> t
type run_error =
| Command_not_found
val spawn : t ‑> prog:string ‑> args:string list ‑> (int, run_error) Pervasives.result
val open_file : t ‑> ?perm:Shexp_process__.Import.Posixat.File_perm.t ‑> flags:Shexp_process__.Import.Posixat.Open_flag.t list ‑> string ‑> Shexp_process__.Import.Unix.file_descr
val with_file : t ‑> ?perm:Shexp_process__.Import.Posixat.File_perm.t ‑> flags:Shexp_process__.Import.Posixat.Open_flag.t list ‑> string ‑> f:(Shexp_process__.Import.Unix.file_descr ‑> 'a) ‑> 'a
val chmod : t ‑> string ‑> perm:int ‑> unit
val chown : t ‑> string ‑> uid:int ‑> gid:int ‑> unit
val mkdir : t ‑> ?perm:int ‑> ?p:bool ‑> string ‑> unit
val rm : t ‑> string ‑> unit
val rmdir : t ‑> string ‑> unit
val mkfifo : t ‑> ?perm:int ‑> string ‑> unit
val rename : t ‑> string ‑> string ‑> unit
val stat : t ‑> string ‑> Shexp_process__.Import.Unix.stats
val lstat : t ‑> string ‑> Shexp_process__.Import.Unix.stats
val readdir : t ‑> string ‑> string list
val access : t ‑> string ‑> Shexp_process__.Import.Unix.access_permission list ‑> unit