I have written a simple class that starts a process and allows the "host" process to do line-based communication with it. I would like a review of both the design and the implementation. Mostly the implementation, since this is the first time I've used most of the POSIX functions used here (pipe, read, write, dup2, etc). It appears to work, as far as I can test, but is there anything I am doing that's dangerous, insecure, may break easily, already broken... etc?
All advices welcomed!
Header and cpp attached.
As an aside, is there a way to do this using threads? (as opposed to processes)
exec apparently won't work because it will replace the whole process.