| Haskell Hierarchical Libraries (unix package) | Contents | Index

System.Posix.Env

Portability | non-portable (requires POSIX)
Stability | provisional
Maintainer | libraries@haskell.org

Description
POSIX environment support
Synopsis

getEnv :: String -> IO (Maybe String)
getEnvDefault :: String -> String -> IO String
getEnvironmentPrim :: IO [String]
getEnvironment :: IO [(String, String)]
putEnv :: String -> IO ()
setEnv :: String -> String -> Bool -> IO ()
unsetEnv :: String -> IO ()

Documentation
getEnv :: String -> IO (Maybe String)
`getEnv` looks up a variable in the environment.
getEnvDefault :: String -> String -> IO String
`getEnvDefault` is a wrapper around getEnvVar where the programmer can specify a fallback if the variable is not found in the environment.
getEnvironmentPrim :: IO [String]
getEnvironment :: IO [(String, String)]
`getEnvironment` retrieves the entire environment as a list of `(key,value)` pairs.
putEnv :: String -> IO ()
`putEnv` function takes an argument of the form `name=value` and is equivalent to `setEnv(key,value,True{-overwrite-})`.
setEnv :: String -> String -> Bool -> IO ()
The setenv function inserts or resets the environment variable name in the current environment list. If the variable `name` does not exist in the list, it is inserted with the given value. If the variable does exist, the argument `overwrite` is tested; if `overwrite` is `False`, the variable is not reset, otherwise it is reset to the given value.
unsetEnv :: String -> IO ()
The unsetenv function deletes all instances of the variable name from the environment.
Produced by Haddock version 0.6