## os -- common OS-related functionality ### Module tree [os](#os) -- miscellaneous functionality - fs -- file system interface - path -- abstract path handling - process -- creating and managing processes ### Index namespace [os](#os) Constants: - ATOMIC_WRITE_CAP -- Maximum number of bytes which can be atomically written to a device Functions: - [run](#run)(_command_: string) => int - [pclose](#pclose)(_pipe_: os::PipeStream) => int - [sleep](#sleep)(_seconds_: float) - [exit](#exit)(_code_ = 0) - [clock](#clock)() => float - [setlocale](#setlocale)(_category_: enum<all,collate,ctype,monetary,numeric,time> = $all, _locale_ = "") - [environ](#environ)() => map<string,string> - [getenv](#getenv)( _name_: string ) => string - [putenv](#putenv)( _name_: string, value = "" ) - [user](#user)() => string - [uname](#uname)() => tuple<_system_: string, _version_: string, _release_: string, _host_: string> - [null](#null)() => io::Stream ### Functions ```ruby run(command: string) => int ``` Executes the given *command* via system shell and returns the resulting exit code ```ruby sleep(seconds: float) ``` Suspends execution of the current thread for the specified amount of *seconds* **Errors:** `Param` when *seconds* is negative ```ruby exit(code = 0) ``` Exits immediately, setting the specified exit *code* ```ruby clock(clock) => float ``` CPU time of the current process in seconds ```ruby setlocale(category: enum = $all, locale = "") => string ``` Sets *locale* for the given *category* and returns previous locale **Errors:** `System` when *locale* is invalid ```ruby environ() => map ``` Process environment ```ruby getenv(name: string) => string ``` Value of environment variable *name* ```ruby putenv(name: string, value = "") ``` Sets environment variable *name* to the given *value* **Errors:** `System` if failed to set environment variable ```ruby user(name: string, value = "") ``` Name of the user associated with the current process **Errors:** `System` if failed to get information about the user ```ruby uname() => tuple ``` Generic system information: operating system name, version and release, computer host name **Errors:** `System` if failed to get information about the system ```ruby null() => io::Stream ``` Returns write-only stream corresponding to system null device **Errors:** `System` if failed to open the null device