API Reference › Os › Os.set_env
method

Os.set_env

Os.set_env(name, value) -> bool

Sets an environment variable for this process (and any children it launches), overwriting any existing value. Returns true on success. Environment changes are process-local and non-deterministic host state — keep them out of the simulation.

Parameters

namethe variable name
valuethe value to set

Example

program SetEnv {
  entry {
    if Os.set_env("LUDIC_MODE", "fast") { print(1) }
  }
}
← All symbols