std.process Module Reference

The std.process module provides primitives for spawning child processes and executing system commands.

process_example.sp
1import std.io;
2import std.process;
3
4fn main() -> void {
5 let exitCode = process.exec("git --version");
6 println("Git check exit code: ${exitCode}");
7}

Exported Functions

process.exec

Native Builtin
fn process.exec(string command) -> int

Spawns a shell command synchronously and returns the exit status code.

Parameters
command(string)
Command string to execute.
Returns:int (0 if process succeeded)