Next: posix pid, Previous: posix cond-expand, Up: posix [Index]
The Scheme level representation of environment variables names and
values is a string, but internally it is a bytevector; strings are
internally converted to bytevectors using string->utf8
.
Interface to the C function getenv()
, (libc)getenv. Retrieve the value of environment variables.
variable must reference a string object representing the name of
the environment variable. If the environment variable is set: return a
string representing its value; else return false.
(getenv "PATH") ⇒ "/usr/local/bin:/usr/bin:/bin"
Interface to the C function setenv()
, (libc)setenv. Set a new value for an environment variable.
variable must reference a string object representing the name of the environment variable; value must reference a string object representing the new value. If overwrite is false and the environment variable already exists: the environment variable is left untouched; else the new value is set, either creating a new environment variable or replacing the old value.
If successful return true, if an error occurs in setenv()
return
false.
Interface to the C function unsetenv()
, (libc)unsetenv. Unset an environment variable. variable must
reference a string object representing the name of the environment
variable. Return true if variable has the correct format, else
return false; there is no way to know if a variable was actually unset.
Interface to the global C variable environ
, (libc)unsetenv. Retrieve the full environment. Return a list of
strings representing the contents of the environ
array; if the
environment is empty (no environment variables set) return nil.
Internally invoke environ
and convert the alist of strings into a
hashtable; return the hashtable. Both keys and values are strings.
Convert between an alist in “environ” format and a hashtable.
Next: posix pid, Previous: posix cond-expand, Up: posix [Index]