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?? |
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.
(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
In Section
Seekers of Perl Wisdom
|
|