See the Process class in the Foundation library, and the Process::launch() member function in the different variants.
To get system() - like behaviour with Process::launch(), you'll have to explicitly create a shell process that executes a command.
On Windows:
- Code: Select all
Process: :Args args;
args.push_back("/C");
args.push_back("DIR");
Process: :launch("CMD.EXE", args);
...
On Unix:
- Code: Select all
Process: :Args args;
args.push_back("-c");
args.push_back("ls");
Process: :launch("sh", args);
...
There is also another variant of Process::launch() that supports I/O redirection using pipes and iostreams.