Next: , Previous: Time, Up: POSIX


38.6 Runtime Environment

— Scheme Procedure: program-arguments
— Scheme Procedure: command-line
— C Function: scm_program_arguments ()

Return a list of the command-line arguments passed to the currently running program. If the program invoked Guile with the ‘-s’, ‘-c’ or ‘--’ switches, these procedures ignore everything up to and including those switches.

— Scheme Procedure: getenv name
— C Function: scm_getenv (name)

Look up the string name in the current environment. The return value is #f unless a string of the form NAME=VALUE is found, in which case return the string VALUE.

— Scheme Procedure: setenv name value

Modify the environment of the current process, which is also the default environment inherited by child processes.

If value is #f, then name is removed from the environment. Otherwise, the string name=value is added to the environment, replacing any existing string with name matching name.

The return value is unspecified.

— Scheme Procedure: environ [env]
— C Function: scm_environ (env) |0 |1 |0

If env is omitted, return the current environment as a list of strings. Otherwise set the current environment, which is also the default environment for child processes, to the supplied list of strings. Each member of env must be of the form NAME=VALUE (it is an error to omit ‘=’, but VALUE is optional). If a NAME appears more than once in env, its value is taken from the first one specified.

— Scheme Procedure: putenv str
— C Function: scm_putenv (str)

Modify the environment of the current process, which is also the default environment inherited by child processes.

If str is of the form NAME=VALUE then it is written directly into the environment, replacing any existing environment string with name matching NAME. If str does not contain an equal sign, then any existing strings with name matching str are removed.