Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by esh (Pilgrim)
on Aug 18, 2003 at 02:25 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://284475]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-23 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found