parent popen to read, how to determine child state? - Unix

This is a discussion on parent popen to read, how to determine child state? - Unix ; If I use popen to read a process how do I know when the child process has terminated and so it won't write anything more and I can safely pclose?...

+ Reply to Thread
Results 1 to 3 of 3

Thread: parent popen to read, how to determine child state?

  1. parent popen to read, how to determine child state?

    If I use popen to read a process how do I know when the child process has
    terminated and so it won't write anything more and I can safely pclose?

  2. Re: parent popen to read, how to determine child state?

    On Aug 7, 7:40*am, "Jyoti Sharma" wrote:
    > If I use popen to read a process how do I know when the child process has*
    > terminated and so it won't write anything more and I can safely pclose?


    use SIGCHLD to catch the exit event of child exits.

    Bin

  3. Re: parent popen to read, how to determine child state?

    On Aug 6, 4:40*pm, "Jyoti Sharma" wrote:

    > If I use popen to read a process how do I know when the child process has*
    > terminated and so it won't write anything more and I can safely pclose?


    You will get EOF on the FILE.

    DS

+ Reply to Thread