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(); } ```