Env

:= []

Read process environment data without losing native operating-system strings.

var! : OsStr => Try(OsStr, [VarNotFound(OsStr), EnvErr(IOErr), ..])

Read an environment variable using an exact native name and value.

var_str! : OsStr => Try(Str, [VarNotFound(OsStr), EnvErr(IOErr), InvalidStr(U64), ..])

Read an environment variable whose value must be valid Unicode text. The name remains native-safe; quoted names work through OsStr.from_quote.

cwd! : () => Try(Path, [CwdUnavailable, ..])

Read the process current working directory as a byte-preserving Path.

set_cwd! : Path => Try({  }, [InvalidCwd(IOErr), ..])

Change the process current working directory.

exe_path! : () => Try(Path, [ExePathUnavailable, ..])

Return the path to the currently running executable.

temp_dir! : () => Path

Return the platform's default temporary directory.

dict! : () => List({ name : OsStr, value : OsStr })

Return all environment variables as exact native { name, value } records. Iteration order is unspecified. A list avoids imposing Unix equality on Windows, where environment variable names are case-insensitive.

platform! : () => { arch : ARCH, os : OS }

Return the architecture and operating system for this host build.

ARCH : [X86, X64, ARM, AARCH64, OTHER(Str)]

CPU architecture reported for the current platform build.

OS : [LINUX, MACOS, WINDOWS, OTHER(Str)]

Operating system reported for the current platform build.