Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by esh (Pilgrim)
on Aug 18, 2003 at 02:25 UTC ( #284475=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://284475]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2021-06-18 06:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (88 votes). Check out past polls.

    Notices?