Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

by esh (Pilgrim)
on Aug 18, 2003 at 02:17 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2021-06-23 18:43 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (121 votes). Check out past polls.