smelt.os¶
Tier: Host — Available in every runtime, including headless mode.
Environment and system primitives: getenv, setenv, platform, cwd, pid, etc.
smelt.os.arch¶
Return the target CPU architecture as reported by std::env::consts::ARCH (e.g. "x86_64", "aarch64").
smelt.os.cwd¶
Return the current working directory as (path, nil), or (nil, err_string) on failure.
smelt.os.getenv¶
Return the value of the environment variable name, or nil if it is not set.
smelt.os.home¶
Return the user's home directory, or nil if it cannot be determined.
smelt.os.pid¶
Return the OS process id of the running smelt instance.
smelt.os.platform¶
Return the target operating system as reported by std::env::consts::OS (e.g. "macos", "linux").
smelt.os.set_cwd¶
Change the process working directory to p. Returns (true, nil) on success or (false, err_string) on failure.
smelt.os.setenv¶
Set the process environment variable name to value. Mutates the live process env; visible to subsequent getenv calls and child processes.
smelt.os.tempdir¶
Return the platform temporary directory path.
smelt.os.unsetenv¶
Remove the environment variable name from the process environment.