From 355a757a178ddaf4b5124fd3555bede9f7eb95c5 Mon Sep 17 00:00:00 2001 From: GigabiteStudios Date: Thu, 18 Jun 2026 21:16:23 -0500 Subject: [PATCH] docs(process): document managed process workflows --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62d9a37..528eedd 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ one consistent API on Windows and Linux. - UTF-8 text, file-list, and RGBA image clipboard access - Native desktop notifications - Standard application, user, temporary, and executable paths -- Non-blocking process launch +- Managed and blocking processes with pipes, timeouts, and output capture - Move-only dynamic library handles with automatic cleanup - Environment variables and basic system information - Monotonic timing and sleeping @@ -97,8 +97,18 @@ auto config = izo::GetKnownPath(izo::KnownPath::Config); izo::ProcessOptions process; process.executable = "tool"; process.arguments = {"--input", "asset.png"}; -if (auto launched = izo::LaunchProcess(process)) { - // launched.processId identifies the new process. +process.captureOutput = true; +process.timeoutMs = 5000; +const auto completed = izo::RunProcess(process); +if (completed.exitCode == 0) { + // completed.stdoutText contains the tool output. +} + +process.pipeStdin = true; +if (auto running = izo::StartProcess(process)) { + running.WriteStdin("input"); + running.CloseStdin(); + running.Wait(); } ```