| Miscellaneous | categories Platform Environment variables |
Process handling |
Additionally to the CLAIRE getenv method, XL CLAIRE provides some tools that make possible to change an environment variable (setenv) or iterate over the whole environment of the process (environ/maxenv) as in :
| (for i in (1 .. maxenv()) let (v, val) := explode_wildcard(environ(i), "*=*") in (assert(getenv(v) = val), printf("~A = ~S\n", v, val))) |
| categories | Environment variables | normal dispatch | [XL] Kernel method |
environ(i) returns the ithenvironment variable (1 based index) in the form "var=value".
| categories | Environment variables | normal dispatch | Core method |
getenv(s) returns the value of the environment variable s if it exists and an empty string otherwise.
| categories | Environment variables | normal dispatch | [XL] Kernel method |
isenv?(v) tests the existence of the environment variable v.
| categories | Environment variables | normal dispatch | [XL] Kernel method |
maxenv() returns the index of the last environment variable. For instance :
| for i in (1 .. maxenv()) printf("~A\n", environ(i)) |
| categories | Environment variables | normal dispatch | [XL] Kernel method |
setenv(s) adds or updates an environment variable defined by s = "var=value".