Module compiler

env

args and cwd need no grant. Reading or changing variables and set_cwd need --allow-env, exec needs --allow-exec and exit needs --allow-exit; see Permissions. exec runs a program with an argument vector, without a shell, in the current working directory and environment.

Built into the compiler.

Import what you use (use path::* is not allowed):

use env::{EnvError, args};

Types#

NameDescription
EnvErrorThe error of every fallible env function.

Functions#

NameDescription
argsReturns the program’s command-line arguments, starting with the program name.
varReturns the value of the environment variable name.
set_varSets the environment variable name to value for this process.
remove_varRemoves the environment variable name from this process.
cwdReturns the current working directory as an absolute path.
set_cwdChanges the current working directory of the whole process.
exitEnds the process at once with exit status code.
execRuns program with the arguments argv and waits for it to finish.
↑ ↓ navigate ↵ open