Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Static class

Environment

static class Environment

Module: System
Assembly: System.Runtime.dll
Source file: Functions.rvn

Provides process environment and execution-platform information.

Process environment

The static Environment class exposes command-line arguments, the current directory and environment-variable lookup. Variable lookup distinguishes an absent value from a host-access error through Optional and Result.

These are host-process services. Check each function's result and documented host behavior rather than assuming a variable or directory is available.

Development APIs also expose GetOperatingSystem(), NewLine, ProcessArchitecture and OSArchitecture. Discovery returns a Result; platform records retain domain-specific versions and provide readable ToString output. Linux distribution details are currently unavailable.

Properties

3 items
Static member: NewLine: string Gets the execution platform's default line separator: CRLF on Windows, LF elsewhere.
Static member: OSArchitecture: Architecture Gets the OS architecture reported by the host, on a best-effort basis under emulation.
Static member: ProcessArchitecture: Architecture Gets the architecture executing this process, which can differ from the OS under emulation.

Methods

4 items
Static member: GetCommandLineArgs() -> string[] Returns a fresh copy of the arguments supplied by the execution host.
Static member: GetCurrentDirectory() -> Result<string, EnvironmentError> Reads the current directory or returns EnvironmentUnavailable.
Static member: GetEnvironmentVariable(name: string) -> Result<Optional<string>, EnvironmentError> Reads a variable; absence is None, while invalid names or inaccessible text return an error.
Static member: GetOperatingSystem() -> Result<OperatingSystem, EnvironmentError> Returns the execution host's OS classification or an unavailable error.