The Standard ML Basis Library

The OS structure

The OS structure is a container for a collection of structures for interacting with the operating system's file system, directory paths, processes and I/O subsystem. The types and functions provided the OS substructures are meant to provide a largely operating system independent model for handling these resources.

The structure also declares the SysErr exception used to report operating system error conditions.


signature OS
structure OS : OS


eqtype syserror
exception SysErr of (string * syserror option)
val errorMsg : syserror -> string
val errorName : syserror -> string
val syserror : string -> syserror option
structure FileSys : OS_FILE_SYS
structure Path : OS_PATH
structure Process : OS_PROCESS
structure IO : OS_IO


eqtype syserror

exception SysErr

errorMsg err
returns a string describing the system error identified by the error code err, as found in a SysErr exception. The form and content of the description strings are operating system dependent. However, if an exception has the form SysErr(s,SOME e), then we have errorMsg e = s.

errorName err
syserror s
These functions provide conversions between the abstract syserror type, and their operating system dependent string names. The primary purpose of these functions is to provide a mechanism for dealing with error codes that might not have symbolic names defined for them in the operating system specific modules. The former function returns a unique name used for the syserror value, while the latter returns the syserror whose name is s, if it exists. If e is a syserror, then it should be the case that
	    SOME e
	      = syserror(errorName e)

structure FileSys

structure Path

structure Process

structure IO

See Also

OS.FileSys, OS.Path, OS.Process, OS.IO

[ INDEX | TOP | Parent | Root ]

Last Modified April 19, 1996
Comments to John Reppy.
Copyright © 1997 Bell Labs, Lucent Technologies