Module process/index
process/index
Process information: platform/arch detection, child-process spawning, and exit.
Environment variables, command-line arguments, and current working
directory live in std/env.
Types
Command
object
Command
Fields
| Name | Type | Description |
|---|---|---|
_program | String | |
_args | ArrayList(String) | |
_stdin_fd | i32 | |
_stdout_fd | i32 | |
_stderr_fd | i32 |
Methods
new : (Command) fn(program : String) -> Commandarg : (Command) fn(self : Command, a : String) -> unitargs : (Command) fn(self : Command, more : ArrayList(String)) -> unitstatus : (Command) fn(self : Command, io : Io) -> Impl(Future(ExitStatus, IoExn))
ExitStatus
struct
ExitStatus
Fields
| Name | Type | Description |
|---|---|---|
raw | i32 |
Methods
code : (ExitStatus) fn(self : ExitStatus) -> i32signal : (ExitStatus) fn(self : ExitStatus) -> i32success : (ExitStatus) fn(self : ExitStatus) -> bool
Output
object
Functions
exit
function
fn(code : usize) -> unit
Exit the process with the given status code.
Parameters
| Name | Type | Notes |
|---|---|---|
code | usize |
Returns: unit
Constants
Current target platform as a compile-time string. One of: "linux", "macos", "windows", "freebsd", "emscripten", "wasi".
Value: "linux"
Platform constants for compile-time platform comparisons.
Value: Platform(Linux: "linux", Macos: "macos", Windows: "windows", FreeBSD: "freebsd", Emscripten: "emscripten", Wasi: "wasi")
Current target architecture as a compile-time string. One of: "x86_64", "aarch64", "x86", "arm", "wasm32".
Value: "x86_64"