Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!dptg!lzga!bogatko From: bogatko@lzga.ATT.COM (George Bogatko) Newsgroups: comp.unix.questions Subject: Re: redirecting standard i/o from an exec'ed programme Summary: crow eating example Keywords: popen, io, exec, system Message-ID: <2021@lzga.ATT.COM> Date: 23 Aug 90 12:45:51 GMT References: <377@fe2o3.UUCP> <2007@lzga.ATT.COM> <3939@auspex.auspex.com> Organization: AT&T BL Middletown/Lincroft NJ USA Lines: 19 In article <3939@auspex.auspex.com>, guy@auspex.auspex.com (Guy Harris) writes: > >Popen is expensive. It requires a shell for 'system' and then > >another shell to run your request in. > > It doesn't use "system()" on any UNIX implementation I've used (V7, BSD, > S3, S5, etc.). It just runs *one* shell, which runs your command. Absolutly right. I goofed. What we saw was an explosion of fork/exec combinations when the application made heavy use of 'popen' instead of directly using fork/exec. I should have said: "Popen is expensive. It requires a fork/exec to invoke the shell and then another fork/exec to run your request." Crow is not digestable, by the way. GB.