home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-07-03 | 2.6 KB | 64 lines | [TEXT/R*ch] |
- (* Miscsys.sig -- not part of the new unified basis, 12-27-94 *)
-
- (* This module provides a simple interface to the operating system. *)
-
- (* exception Io of string; *)
- (* This exception is identical to sys__Sys_error in Caml Light.
- Raised by some functions, when the underlying system calls
- fail. The argument to [Io] is a string describing the error.
- The texts of the error messages are implementation-dependent,
- and should not be relied upon to catch specific system errors. *)
-
- prim_val command_line : string Vector.vector = 0 "command_line";
- (* The command line arguments given to the process.
- The first element is the command name used to invoke the
- program. *)
-
- prim_val interactive: bool = 0 "interactive";
- (* True if we're running under the toplevel system. False if
- we're running as a standalone program. *)
-
- prim_val exit : int -> 'a = 1 "sys_exit";
- (* Terminate the program and return the given status code to
- the operating system.
- In contrast with the function [exit] from module [io], this
- [exit] function does not flush the standard
- output and standard error channels. *)
-
- prim_val getenv : string -> string = 1 "sys_getenv";
- (* Return the value associated to a variable in the process
- environment. Raise [Not_found] if the variable is unbound. *)
-
- prim_val catch_interrupt : bool -> unit = 1 "sys_catch_break"
- (* Currently, this doesn't work properly in the top-level system,
- because it calls this primitive itself to prevent the system
- from being interrupted while in critical intervals. *)
- (* [catch_interrupt] governs whether user interrupt terminates
- the program or raises the [Interrupt] exception. Call
- [catch_interrupt true] to enable raising [Interrupt],
- and [catch_interrupt false] to let the system terminate
- the program on user interrupt. *)
-
- prim_val system : string -> int = 1 "sml_system";
- (* [system] executes a command of the underlying operating
- system. If the argument is an empty string, this may
- produce strange results under MS DOS. *)
-
-
- val remove : string -> unit
-
- val rename : {old: string, new: string} -> unit
-
- val chdir : string -> unit
-
-
- (* [remove f] deletes the file [f] from the operating system.
-
- [rename{new, old}] renames file [old] to [new].
-
- [chdir dir] changes the current working directory of the process.
- Note that there is no easy way of getting the current working
- directory from the operating system.
- *)
-
-