module Sys: BatSysval argv : string arrayval executable_name : stringval file_exists : string -> boolval is_directory : string -> booltrue if the given name refers to a directory,
false if it refers to another kind of file.Sys_error if no file exists with the given name.val remove : string -> unitval rename : string -> string -> unitrename may replace it, or raise an
exception, depending on your operating system.val getenv : string -> stringNot_found if the variable is unbound.val command : string -> intval time : unit -> floatval chdir : string -> unitval getcwd : unit -> stringval readdir : string -> string array"." 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 Pervasives.reffalse in standalone
programs and to true if the code is being executed under
the interactive toplevel system ocaml.val os_type : string"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).val unix : boolSys.os_type = "Unix".val win32 : boolSys.os_type = "Win32".val cygwin : boolSys.os_type = "Cygwin".val word_size : intval int_size : intval big_endian : boolval max_string_length : intval max_array_length : intmax_array_length/2 on 32-bit machines and
max_array_length on 64-bit machines.val runtime_variant : unit -> string-runtime-variant at compile
time, but for byte-code it can be changed after compilation.val runtime_parameters : unit -> stringOCAMLRUNPARAM environment variable.typesignal_behavior =Sys.signal_behavior=
| |
Signal_default |
|||
| |
Signal_ignore |
|||
| |
Signal_handle of |
(* |
What to do when receiving a signal:
| *) |
val signal : int -> signal_behavior -> signal_behaviorInvalid_argument If the signal number is
invalid (or not available on your system).val set_signal : int -> signal_behavior -> unitSys.signal but return value is ignored.val sigabrt : intval sigalrm : intval sigfpe : intval sighup : intval sigill : intval sigint : intval sigkill : intval sigpipe : intval sigquit : intval sigsegv : intval sigterm : intval sigusr1 : intval sigusr2 : intval sigchld : intval sigcont : intval sigstop : intval sigtstp : intval sigttin : intval sigttou : intval sigvtalrm : intval sigprof : intval sigbus : intval sigpoll : intval sigsys : intval sigtrap : intval sigurg : intval sigxcpu : intval sigxfsz : intexception Break
Sys.catch_break
is on.val catch_break : bool -> unitcatch_break governs whether interactive interrupt (ctrl-C)
terminates the program or raises Break.
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 OCaml.
It is a string of the form "major.minor[.patchlevel][+additional-info]",
where major, minor, and patchlevel are integers, and
additional-info is an arbitrary string. The [.patchlevel] and
[+additional-info] parts may be absent.val files_of : string -> string BatEnum.tBatSys.readdir but the results are presented as an enumeration
of names.val enable_runtime_warnings : bool -> unitopen_* functions is finalized without
being closed. Runtime warnings are enabled by default.val runtime_warnings_enabled : unit -> boolval opaque_identity : 'a -> 'aopaque_identity behaves like an
unknown (and thus possibly side-effecting) function.
At runtime, opaque_identity disappears altogether.
A typical use of this function is to prevent pure computations from being optimized away in benchmarking loops. For example:
for _round = 1 to 100_000 do
ignore (Sys.opaque_identity (my_pure_computation ()))
done
The compiler primitive was added to OCaml 4.03, but we emulate it
under 4.02 using the -opaque compilation flag. There is no easy
way for Batteries to emulate it correctly under older OCaml
versions.
Since 2.5.0 and OCaml 4.02