From b27b128f97596236a4ce6a3d9b40ef3dfad84d06 Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Fri, 30 Jan 2026 00:34:33 +0000 Subject: New standard lib (std/process.zc). --- examples/process/exec.zc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 examples/process/exec.zc (limited to 'examples') diff --git a/examples/process/exec.zc b/examples/process/exec.zc new file mode 100644 index 0000000..712a356 --- /dev/null +++ b/examples/process/exec.zc @@ -0,0 +1,20 @@ + +import "std/process.zc"; +import "std/string.zc"; + +fn main() { + "Executing 'ls -la' using std/process..."; + + let output = Command::new("ls") + .arg("-l") + .arg("-a") + .output(); + + if output.exit_code == 0 { + "--- Output ---"; + output.stdout.print(); + "--------------"; + } else { + !"Command failed with exit code: {output.exit_code}"; + } +} -- cgit v1.2.3