| Copyright | (c) Habib Alamin 2017 |
|---|---|
| License | BSD-style (see the file libraries/base/LICENSE) |
| Maintainer | libraries@haskell.org |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
System.Environment.Blank
Description
A setEnv implementation that allows blank environment variables. Mimics theEnv module from theunix package, but with support for Windows too.
The matrix of platforms that:
putenv(FOO) to unset environment variables,putenv("FOO=") to unset environment variables or set them to blank values,unsetenv to unset environment variables,setenv to set environment variables,is very complicated. Some platforms don't support unsetting of environment variables at all.
getExecutablePath ::IOFilePathSource#
Returns the absolute pathname of the current executable.
Note that for scripts and interactive sessions, this is the path to the interpreter (e.g. ghci.)
Since base 4.11.0.0,getExecutablePath resolves symlinks on Windows. If an executable is launched through a symlink,getExecutablePath returns the absolute path of the original executable.
Since: 4.6.0.0
ComputationgetArgs returns a list of the program's command line arguments (not including the program name).
ComputationgetProgName returns the name of the program as it wasinvoked.
However, this is hard-to-impossible to implement on some non-UnixOSes, so instead, for maximum portability, we just return the leafnameof the program as invoked. Even then there are some differencesbetween platforms: on Windows, for example, a program invoked as foois probably reallyFOO.EXE, and that is whatgetProgName will return.
withProgName ::String ->IO a ->IO aSource#
withProgNamename act - while executing actionact,havegetProgName returnname.
getEnvironment ::IO [(String,String)]Source#
getEnvironment retrieves the entire environment as a list of(key,value) pairs.
If an environment entry does not contain an'=' character, thekey is the whole entry and thevalue is the empty string.
Get an environment value or a default value.
Produced byHaddock version 2.20.0