14.4 Environment Variables
| import: rhombus/envvar | package: rhombus-lib |
annotation | |
| |
| |
annotation | |
|
function | ||||
| ||||
| ||||
function | ||||
|
The underlying environment-variables object works in terms of byte strings. String names and values are converted using the current locale’s default encoding, using Char"?" as the replacement character for encoding errors.
The gettenv and putenv functions use EnvVars.current to get the current environment variables, and then use EnvVars.get or EnvVars.set to get or set the byte-string encoding of name.
The putenv function returns #true for success and #false for failure, where failure is only possible when EnvVars.current returns the original EnvVars object for the process.
class | |||
| |||
| |||
method | |||
| |||
context parameter | |||
|
The initial value of EnvVars.current corresponds to the process’s environment variables. Setting an environment variable in that object adjusts the table of environment variables at the operating-system process level.
Creating a new set of environment variables via EnvVars.copy or the EnvVars allocates an object with independent state.
method | |||||
| |||||
| |||||
method | |||||
|
If envvars is the initial value of EnvVars.current in the process, setting an environment variable adjusts the table of environment variables at the operating-system process level.
Setting an environment variable to #false removes it from the set of environment-variable names and/or unsets it at the process level.
method | ||
property | |
| |
function | |
|