in reply to Re: When starting a process, at what point does "open()" return?
in thread When starting a process, at what point does "open()" return?

The open call will return when the process exits
This is not true on operating systems I'm familiar with and I doubt it's true on Windows, either. The open call returns when the process starts not when it exits. You can then have the child process talking with the parent process while both are running at the same time.

Here's proof:

perl -e 'open F, "sleep 60 |" or die "$!\n"; print "done\n"'

I know that "sleep 60" takes about 60 seconds to run, but my top perl program prints "done" right away and exits. It does not wait for the "sleep 60" to exit.

The related system call does wait for the child return when the child process exits.

-- Eric Hammond

  • Comment on Re: Re: When starting a process, at what point does "open()" return?
  • Download Code