fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

Idiom # 111: Launch other program

See programming-idioms.org:

Code

os.process.start runs program x with arguments a and b. It returns os.process outcome, throwing an error if the program fails to start (e.g., if it does not exist). To wait for the program to finish and get its exit code, call wait on the returned process.

Runnable Example

The program's output goes to a pipe instead of the terminal. To read it, with_out passes the process output to io.buffered, which requires a mutate effect, here lm. Then read_string reads the entire output. Using bind ensures this happens only if the program was started successfully, making out an outcome String.

last changed: 2026-10-14