I need to run a program, feed some strings on its stdin, read its stdout/stderr and know how it ended. I have to know if it received a signal (segfault, etc) and its exit code. Also, if the program runs for more than some amount of time, I have to know it (and kill it).
How would you do that? Is there a module that handles this kind of things?
Ok here’s what I came up with: (usage example at the end)