Function set "Environment support"

Functions used to access the process environment variables.

more...

Summary

getenv()Get environment variable value.
setenv()Set environment variable value.
unsetenv()Clear environment variable value.

Detailed description

Functions used to access the process environment variables.

Environment variables are an handful way to provide system wide configuration. Falcon RTL getenv(), setenv() and unsetenv() functions peek and manipulates environment variables.

Variables set with "setenv()" will be available to child processes in case they are launched with the utilities in the Process module.

Members

getenv()

Get environment variable value.

getenv( varName )

varNameEnvironment variable name (as a string)
Returns:The value of the environment variable or nil if it is not present.

This function returns a string containing the value set for the given environment variable by the operating system before starting the Falcon process or or by a previous call to setenv(). If the given variable name is not declared, the function will return nil.

On some systems (e.g. MS-Windows), setting a variable to an empty string is equivalent to unsetting it, so getenv() will never return an empty string. On other systems, environment variables may be set to empty strings, that may be returned by getenv().

setenv()

Set environment variable value.

setenv( varName, value )

varNameEnvironment variable name (as a string)
valuea value for the given variable.
Raises:
IoErroron failure.

This function sets the given value for the given environment variable. The varName parameter must be a string, while value may be any Falcon value. If the value is not a string, it will be converted using the toString() function.

If the variable was previously set to a different value, its value is changed; if it doesn't existed, it is created.

The function may fail if the system cannot perform the operation; this may happen if the space that the system reserves for environment variables is exhausted. In this case, the function raises an error.

unsetenv()

Clear environment variable value.

unsetenv( varName )

varNameEnvironment variable name (as a string)

This function removes a given variable setting, causing subsequents getenv( varName ) to return nil.


Made with faldoc 2.1.0