home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Moscow ML 1.31 / source code / mosml / src / compiler / Miscsys.sig < prev    next >
Encoding:
Text File  |  1996-07-03  |  2.6 KB  |  64 lines  |  [TEXT/R*ch]

  1. (* Miscsys.sig -- not part of the new unified basis, 12-27-94 *)
  2.  
  3. (* This module provides a simple interface to the operating system. *)
  4.  
  5. (* exception Io of string; *)
  6.         (* This exception is identical to sys__Sys_error in Caml Light.
  7.            Raised by some functions, when the underlying system calls
  8.            fail. The argument to [Io] is a string describing the error.
  9.            The texts of the error messages are implementation-dependent,
  10.            and should not be relied upon to catch specific system errors. *)
  11.  
  12. prim_val command_line : string Vector.vector = 0 "command_line";
  13.         (* The command line arguments given to the process.
  14.            The first element is the command name used to invoke the
  15.            program. *)
  16.  
  17. prim_val interactive: bool = 0 "interactive";
  18.         (* True if we're running under the toplevel system. False if
  19.            we're running as a standalone program. *)
  20.  
  21. prim_val exit : int -> 'a = 1 "sys_exit";
  22.         (* Terminate the program and return the given status code to
  23.        the operating system.
  24.            In contrast with the function [exit] from module [io], this
  25.            [exit] function does not flush the standard
  26.            output and standard error channels. *)
  27.  
  28. prim_val getenv : string -> string = 1 "sys_getenv";
  29.         (* Return the value associated to a variable in the process
  30.            environment. Raise [Not_found] if the variable is unbound. *)
  31.  
  32. prim_val catch_interrupt : bool -> unit = 1 "sys_catch_break"
  33.   (* Currently, this doesn't work properly in the top-level system,
  34.      because it calls this primitive itself to prevent the system
  35.      from being interrupted while in critical intervals. *)
  36.         (* [catch_interrupt] governs whether user interrupt terminates
  37.            the program or raises the [Interrupt] exception. Call
  38.            [catch_interrupt true] to enable raising [Interrupt],
  39.            and [catch_interrupt false] to let the system terminate
  40.            the program on user interrupt. *)
  41.  
  42. prim_val system : string -> int = 1 "sml_system";
  43.         (* [system] executes a command of the underlying operating
  44.            system. If the argument is an empty string, this may
  45.            produce strange results under MS DOS. *)
  46.  
  47.  
  48. val remove : string -> unit
  49.  
  50. val rename : {old: string, new: string} -> unit
  51.  
  52. val chdir  : string -> unit
  53.  
  54.  
  55. (* [remove f] deletes the file [f] from the operating system.
  56.  
  57.    [rename{new, old}] renames file [old] to [new].
  58.  
  59.    [chdir dir] changes the current working directory of the process.
  60.    Note that there is no easy way of getting the current working
  61.    directory from the operating system.
  62. *)
  63.  
  64.