class pipe_exec : public std iostream, public prog_exec p2open equivalent
| | pipe_exec (const char* cmd, const char* mode = "rw") Constructor |
| | ~pipe_exec () Destuctor |
| | close () Closes the pipes |
| | operator! () Returns true on error |
| | wait (int* stat_loc = 0, bool poll = false) Wait for child to terminate (returns exit code) If poll is true, the method will not block and return 0 in case the child process is still alive |
| | wait (double timeout, int* stat_loc = 0) Wait for child to terminate with timeout |
| | getmode () const Returns the mode string |
| | setmode (const char* mode) set the mode |
Pipe_exec. Starts a child process with fork, executes the string cmd with execlp and creates a bidirectional pipe to and from the child's standard input and standard output, respectively. pipe_exec inherits from iostream and the << and >> operators can be used to receive and send data from and to the child, respectively. This implementation uses non buffered output to make sure that the all characters are written to the child process before any read operation is performed. Child processes which use buffered IO might block the communication when they are trying to write a result back in the middle of receiving a block of data.
virtual ~pipe_exec()
virtual void close()
virtual bool operator!()
virtual int wait(int* stat_loc = 0, bool poll = false)
virtual int wait(double timeout, int* stat_loc = 0)
alphabetic index hierarchy of classes
Please send questions and comments to zweizig_j@ligo.caltech.edu
generated by doc++