2003-05-08 22:17:26 +04:00
|
|
|
#include <kwsys/Directory.hxx>
|
2003-06-10 23:50:45 +04:00
|
|
|
#include <kwsys/Process.h>
|
|
|
|
#include <kwsys/std/iostream>
|
2003-05-08 22:17:26 +04:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
kwsys::Directory();
|
2003-06-10 23:50:45 +04:00
|
|
|
kwsysProcess* kp = kwsysProcess_New();
|
|
|
|
const char* cmd[] = {"echo", "Hello, World!", 0};
|
|
|
|
kwsysProcess_SetCommand(kp, cmd);
|
|
|
|
kwsysProcess_Execute(kp);
|
|
|
|
char* data = 0;
|
|
|
|
int length = 0;
|
2003-12-05 19:53:17 +03:00
|
|
|
while(kwsysProcess_WaitForData(kp, &data, &length, 0))
|
2003-06-10 23:50:45 +04:00
|
|
|
{
|
|
|
|
kwsys_std::cout.write(data, length);
|
|
|
|
}
|
|
|
|
kwsysProcess_Delete(kp);
|
|
|
|
kwsys_std::cout << kwsys_std::endl;
|
2003-05-08 22:17:26 +04:00
|
|
|
return 0;
|
|
|
|
}
|