> interface LibSystem where
The ExitCode
type defines the exit codes that a program
can return. ExitSuccess
indicates successful termination;
and ExitFailure
code indicates program failure
with value code. The exact interpretation of code
is operating-system dependent. In particular, some values of
code may be prohibited (e.g. 0 on a POSIX-compliant system).
> data ExitCode = ExitSuccess | ExitFailure Int > getArgs :: IO [String] > getProgName :: IO String > getEnv :: String -> IO String > system :: String -> IO ExitCode > exitWith :: ExitCode -> IO a
Computation getArgs
returns a list of the program's command
line arguments (not including the program name).
Computation getProgName
returns the name of the program
as it was invoked.
Computation getEnv
var returns the value
of the environment variable var.
This computation may fail with
NoSuchThing
Computation system
cmd returns the exit code
produced when the operating system processes the command cmd.
This computation may fail with
PermissionDenied
ResourceExhausted
UnsupportedOperation
Computation exitWith
code terminates the
program, returning code to the program's caller.
Before it terminates, any open or semi-closed handles are first closed.