Process (std.process)
Flame provides clean, native access to operating system metadata, process execution, and environment configuration without requiring boilerplate wrapper functions.
Child Processes (std.process)
Section titled “Child Processes (std.process)”Execute shell commands, interact with background processes, and manage working directories directly at the script top level:
import std.process
// Execute a command synchronously and capture its standard output, error, and exit statuslet output = process.exec("git", ["status", "--short"])println($"Git status exit code: {output.status.code}")println($"Git stdout:\n{output.stdout}")
// Spawn an asynchronous background processlet child = process.spawn("cargo", ["--version"])
// Inspect and change the current working directorylet current_path = process.cwd()println($"CWD: {current_path}, Flame PID: {process.pid()}")API Summary Tables
Section titled “API Summary Tables”Process (std.process)
Section titled “Process (std.process)”| Method | Arguments | Returns | Description |
|---|---|---|---|
process.exec |
cmd: String, args: Tuple<String> |
Formula |
Runs command synchronously and returns { stdout, stderr, status: { code } }. |
process.spawn |
cmd: String, args: Tuple<String> |
ChildProcess |
Spawns an asynchronous background child process. |
process.cmd |
program: String |
CommandBuilder |
Returns a command builder for chained argument configuration and spawning. |
process.cwd |
None | String |
Returns the current working directory path of the running process. |
process.set_cwd |
path: String |
Nil |
Changes the current working directory to the specified path. |
process.pid |
None | Int |
Returns the operating system process ID of the running Flame process. |
