in reply to fork(): when parent exits, what happens to child?

You are suffering from buffering, if you wait long enough you will see all numbers in the file.

Or put the open (with '>>' instead of '>') and close into the loop and you can see that the numbers drop in one by one

It would have helped if you mentioned what OS you were talking about (ok, the word pseudo seem to suggest Windows)

  • Comment on Re: fork(): when parent exits, what happens to child?