module Sys:sig..end
System interface.
val argv : string arrayThe command line arguments given to the process. The first element is the command name used to invoke the program. The following elements are the command-line arguments given to the program.
val executable_name : stringThe name of the file containing the executable currently running.
val file_exists : string -> boolTest if a file with the given name exists.
val remove : string -> unitRemove the given file name from the file system.
val rename : string -> string -> unitRename a file. The first argument is the old name and the second is the new name.
val getenv : string -> stringReturn the value associated to a variable in the process
environment. Raise Not_found if the variable is unbound.
val command : string -> intExecute the given shell command and return its exit code.
val time : unit -> floatReturn the processor time, in seconds, used by the program since the beginning of execution.
val chdir : string -> unitChange the current working directory of the process.
val getcwd : unit -> stringReturn the current working directory of the process.
val readdir : string -> string arrayReturn the names of all files present in the given directory.
Names denoting the current directory and the parent directory
("." and ".." in Unix) are not returned. Each string in the
result is a file name rather than a complete path. There is no
guarantee that the name strings in the resulting array will appear
in any specific order; they are not, in particular, guaranteed to
appear in alphabetical order.
val interactive : bool Stdlib.refThis reference is initially set to false in standalone
programs and to true if the code is being executed under
the interactive toplevel system ocaml.
val os_type : stringOperating system currently executing the Caml program. One of
"Unix" (for all Unix versions, including Linux and Mac OS X),"Win32" (for MS-Windows, OCaml compiled with MSVC++ or Mingw),"Cygwin" (for MS-Windows, OCaml compiled with Cygwin),"MacOS" (for MacOS 9).val word_size : intSize of one word on the machine currently executing the Caml program, in bits: 32 or 64.
val max_string_length : intMaximum length of a string.
val max_array_length : intMaximum length of an array.
type signal_behavior =
| |
Signal_default |
|||
| |
Signal_ignore |
|||
| |
Signal_handle of |
(* | What to do when receiving a signal:
| *) |
val set_signal : int -> signal_behavior -> unitSame as Sys.signal but return value is ignored.
val sigabrt : intAbnormal termination
val sigalrm : intTimeout
val sigfpe : intArithmetic exception
val sighup : intHangup on controlling terminal
val sigill : intInvalid hardware instruction
val sigint : intInteractive interrupt (ctrl-C)
val sigkill : intTermination (cannot be ignored)
val sigpipe : intBroken pipe
val sigquit : intInteractive termination
val sigsegv : intInvalid memory reference
val sigterm : intTermination
val sigusr1 : intApplication-defined signal 1
val sigusr2 : intApplication-defined signal 2
val sigchld : intChild process terminated
val sigcont : intContinue
val sigstop : intStop
val sigtstp : intInteractive stop
val sigttin : intTerminal read from background process
val sigttou : intTerminal write from background process
val sigvtalrm : intTimeout in virtual time
val sigprof : intProfiling interrupt
exception Break
Exception raised on interactive interrupt if Sys.catch_break
is on.
val catch_break : bool -> unitcatch_break governs whether interactive interrupt (ctrl-C)
terminates the program or raises the Break exception.
Call catch_break true to enable raising Break,
and catch_break false to let the system
terminate the program on user interrupt.
val ocaml_version : stringocaml_version is the version of Objective Caml.
It is a string of the form "major.minor[additional-info]"
Where major and minor are integers, and additional-info is
a string that is empty or starts with a '+'.