MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / processSnippet5

Method processSnippet5

Tests/Libraries/Process/ProcessTest.cpp:543–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541}
542
543SC::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
558namespace SC
559{

Callers

nothing calls this directly

Calls 4

readUntilEOFMethod · 0.80
waitForExitSyncMethod · 0.80
ResultClass · 0.50
launchMethod · 0.45

Tested by

no test coverage detected