| 541 | } |
| 542 | |
| 543 | SC::Result SC::ProcessTest::processSnippet5() |
| 544 | { |
| 545 | //! [ProcessSnippet5] |
| 546 | // Example: read process output using a pipe, using launch + waitForExitSync |
| 547 | Process process; |
| 548 | PipeDescriptor outputPipe; |
| 549 | SC_TRY(process.launch({"executable.exe", "--argument1", "--argument2"}, outputPipe)); |
| 550 | String output = StringEncoding::Ascii; // Could also use SmallString<N> |
| 551 | SC_TRY(outputPipe.readPipe.readUntilEOF(output)); |
| 552 | SC_TRY(process.waitForExitSync()); |
| 553 | // ... Do something with the 'output' string |
| 554 | //! [ProcessSnippet5] |
| 555 | return Result(true); |
| 556 | } |
| 557 | |
| 558 | namespace SC |
| 559 | { |
nothing calls this directly
no test coverage detected