Module OpamStd.Sys
Querying
type os=|Darwin|Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|Cygwin|Win32|Unix|Other of string
val os : unit -> osQueried lazily
val uname : string -> string optionThe output of the command "uname", with the given argument. Memoised.
val executable_name : string -> stringAppend .exe (only if missing) to executable filenames on Windows
type shell=|SH_sh|SH_bash|SH_zsh|SH_csh|SH_fishThe different families of shells we know about
val guess_shell_compat : unit -> shellGuess the shell compat-mode
val guess_dot_profile : shell -> stringGuess the location of .profile
val split_path_variable : ?clean:bool -> string -> string listSplits a PATH-like variable separated with
path_sep. More involved than it seems, because there may be quoting on Windows. By default, it returns the path cleaned (remove trailing, leading, contiguous delimiters). Optional argumentcleanpermits to keep those empty strings.
Exit handling
val at_exit : (unit -> unit) -> unitLike Pervasives.at_exit but with the possibility to call manually (eg. before exec())
val exec_at_exit : unit -> unitCalls the functions registered in at_exit. Unneeded if exiting normally
exceptionExec of string * string array * string arrayIndicates intention to exec() the given command (paramters as per
Unix.execvpe), after proper finalisations. It's the responsibility of the main function to catch this, callexec_at_exit, andUnix.execvpe.
type exit_reason=[]
val exit_codes : (exit_reason * int) listval get_exit_code : exit_reason -> intval exit_because : exit_reason -> 'aRaises
Exit, with the code associated to the exit reason