Process example
#include <iostream>
int main(int argc, char** argv)
{
if (argc > 1)
{
std::cout << "Executing child process..." << std::endl;
int result = child.
Wait();
std::cout << "Executed child process! Result = " << result << std::endl;
return 0;
}
return 123;
}
static Process Execute(const std::string &command, const std::vector< std::string > *arguments=nullptr, const std::map< std::string, std::string > *envars=nullptr, const std::string *directory=nullptr, Pipe *input=nullptr, Pipe *output=nullptr, Pipe *error=nullptr)
Execute a new process.
static uint64_t ParentProcessId() noexcept
Get the parent process Id.
int Wait()
Wait the process to exit.
static uint64_t CurrentProcessId() noexcept
Get the current process Id.