in reply to Re: Question on fork and close.
in thread Question on fork and close.

I doubt that the @files Array is exhausted. So most likely it is my some stuff that is causing the problem. (This is not in a CGI environment. Just a straight script.)

I'm guessing that this is the offending line.

open2(\*GZIP_IN, \*GZIP_OUT, "$gzip -dc -q $outfile$$") or die "cannot + open2 $gzip: $!";

Again, this should only be one fork (for the one file that gzip is acting upon). At least I think it should be just one fork. (Obviously it isn't. :) )

Replies are listed 'Best First'.
Re: Re: Re: Question on fork and close.
by kschwab (Vicar) on May 30, 2001 at 00:19 UTC
    Opening a pipe both from and to "gzip -dc" ? Perhaps if you are doing line-mode input from the compressed source, that's the problem:
    while (<WHEREEVERTHECOMPRESSEDDATAIS>) { # $_ could be potentially huge, if it doesn't # contain a newline somewhere soon print GZIP_IN; }
    See read() or sysread() if that's it. But then, that's just a guess...good luck.