18void WvSystem::init(
const char *
const *argv)
21 WvSubProc::preparev(argv[0], argv);
27static void fd_open(
int fd, WvStringParm file,
int mode)
30 int nfd = ::open(file, mode, 0666);
42int WvSystem::fork(
int *waitfd)
44 int pid = WvSubProc::fork(waitfd);
47 if (!fdfiles[0].isnull())
48 fd_open(0, fdfiles[0], O_RDONLY);
49 if (!fdfiles[1].isnull())
50 fd_open(1, fdfiles[1], O_WRONLY|O_CREAT);
51 if (!fdfiles[2].isnull())
52 fd_open(2, fdfiles[2], O_WRONLY|O_CREAT);
63 WvSubProc::start_again();
66 WvSubProc::wait(-1,
false);
67 return WvSubProc::estatus;
73 fdfiles[0] = filename;
80 fdfiles[1] = filename;
87 fdfiles[2] = filename;
WvSystem & infile(WvStringParm filename)
Redirect stdin from the given input file.
int go()
Explicitly start the command running and wait for it to finish.
virtual ~WvSystem()
Destroy the WvSystem object.
WvSystem & outfile(WvStringParm filename)
Redirect stdout to the given output file, which is overwritten.
WvSystem(const char cmd[], const char *a0=NULL, const char *a1=NULL, const char *a2=NULL, const char *a3=NULL, const char *a4=NULL, const char *a5=NULL, const char *a6=NULL, const char *a7=NULL, const char *a8=NULL, const char *a9=NULL, const char *a10=NULL, const char *a11=NULL, const char *a12=NULL, const char *a13=NULL, const char *a14=NULL, const char *a15=NULL, const char *a16=NULL, const char *a17=NULL, const char *a18=NULL, const char *a19=NULL)
Construct a WvSystem from a simple list of strings.
WvSystem & errfile(WvStringParm filename)
Redirect stderr to the given output file, which is overwritten.