Skip to content
Snippets Groups Projects
Commit e5b6fc46 authored by Brad King's avatar Brad King
Browse files

ENH: Added use of process execution.

parent c485feba
No related branches found
No related tags found
No related merge requests found
#include <kwsys/Directory.hxx>
#include <kwsys/Process.h>
#include <kwsys/std/iostream>
int main()
{
kwsys::Directory();
kwsysProcess* kp = kwsysProcess_New();
const char* cmd[] = {"echo", "Hello, World!", 0};
kwsysProcess_SetCommand(kp, cmd);
kwsysProcess_Execute(kp);
char* data = 0;
int length = 0;
while(kwsysProcess_WaitForData(kp, kwsysProcess_STDOUT | kwsysProcess_STDERR,
&data, &length, 0))
{
kwsys_std::cout.write(data, length);
}
kwsysProcess_Delete(kp);
kwsys_std::cout << kwsys_std::endl;
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment