Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by esh (Pilgrim)
on Aug 18, 2003 at 02:17 UTC ( [id://284471]=note: print w/replies, xml ) Need Help??


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

I'm not speaking from a personal knowledge of the Perl source code, but I have always been under the assumption that open calls with leading or trailing pipes do a fork/exec to start the subprocess.

If the exec fails (e.g., can't find the command) then the open returns a failure (in the parent process). If the exec succeeds, then the open returns success (in the parent process) and your program can start reading or writing to the sub-process.

You may get more clues about behavior you're seeing from the fork and exec documentation.

perldoc -f fork perldoc -f exec

(All of my posts should be implicitly prefaced with the fact that I only speak of Unix/Linux/Solaris/... In my world I tend to forget that there are environments like Windows/OS2/VMS...)

-- Eric Hammond

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found