System.SetEnv

setenv-0.1.1.3: A cross-platform library for setting environment variables

Safe Haskell | Safe
Language | Haskell98

System.SetEnv

Synopsis

- setEnv :: String -> String -> IO ()
- unsetEnv :: String -> IO ()

# Documentation

setEnv :: String -> String -> IO () #

`setEnv name value` sets the specified environment variable to `value`.

On Windows setting an environment variable to the empty string removes that environment variable from the environment. For the sake of compatibility we adopt that behavior. In particular

    setEnv name ""

has the same effect as

    unsetEnv name

If you don't care about Windows support and want to set an environment variable to the empty string use `System.Posix.Env.setEnv` from the `unix` package instead.

Throws `IOException` if `name` is the empty string or contains an equals sign.

Since: 4.7.0.0

unsetEnv :: String -> IO () #

`unSet name` removes the specified environment variable from the environment of the current process.

Throws `IOException` if `name` is the empty string or contains an equals sign.

Since: 4.7.0.0