in reply to Re^2: wait versus close on a pipe
in thread wait versus close on a pipe
A few things:
- Since close does a wait, there's no reason to close the pipe and try to reap the child (unless you were referring to IPC::Open3 there).
- If you close before the child terminates, the child will get a SIGPIPE only if it tries to write to the closed pipe (I think). It could ignore that, but it also might not ever trigger it, if it was done writing anyway.
- A close would send EOF to the child only if the child were reading. Since the child is writing, I don't think I'd call that EOF. Rather, it's SIGPIPE.
- I'm writing all this without testing it, and I'm starting to wonder if I should try some of these things before I talk further.