Library to access parts of the system environment.
Exported Functions: getArgs, getEnv, getHostname, getProgName, isPosix, isWindows, setEnv, unsetEnv
Returns the list of the program's command line arguments. The program name is not included.
Returns the value of an environment variable. The empty string is returned for undefined environment variables.
setEnv
:: String -> String -> IO ()
Set an environment variable to a value.
The new value will be passed to subsequent shell commands
(see code
system/code
) and visible to subsequent calls to
code
getEnv/code
(but it is not visible in the environment
of the process that started the program execution).
Removes an environment variable that has been set by
code
setEnv/code
.
getHostname
:: IO String
Returns the hostname of the machine running this process.
getProgName
:: IO String
Returns the name of the current program, i.e., the name of the main module currently executed.
Is the underlying operating system a POSIX system (unix, MacOS)?
Is the underlying operating system a Windows system?