octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: popen2 vs pclose


From: Jaroslav Hajek
Subject: Re: popen2 vs pclose
Date: Wed, 26 Aug 2009 08:08:45 +0200

On Tue, Aug 25, 2009 at 11:44 PM, John W. Eaton<address@hidden> wrote:
> On 25-Aug-2009, Rob Mahurin wrote:
>
> | I think the documentation solution is the simplest and the least
> | likely to cause mysteries later on.
>
> I agree.  I checked in the following change.
>
>  http://hg.savannah.gnu.org/hgweb/octave/rev/c60a9e1a0372
>
> Note that we were also leaving zombies for something as simple as
>
>  ...plot something...
>  close all
>
> The patch I checked in should also fix that problem.
>
> The popen2 docstring still needs to have a note added.  I'd be
> grateful if someone else could take care of that.
>
> Thanks,
>
> jwe
>

I'm likewise happy with this situation; where popen2 is just shortcut
for pipe&fork&exec. This is also cleaner because there is no confusion
about which pclose returns the exit code. Further, I think it would be
wrong to wait for the child as soon as *either* stream is closed; I
can think of numerous cases where you want to close the process's
input but keap reading its output.

regards

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]