docs(process): document managed process workflows
All checks were successful
Linux unit tests / unit-tests (push) Successful in 48s
All checks were successful
Linux unit tests / unit-tests (push) Successful in 48s
This commit is contained in:
16
README.md
16
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();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user