"NeilS" <> wrote:
> >
> > fork, and then the parent should exit normally, and the child
> > should close (or reopen) STDOUT and STDERR and then exec (or just
> > proceed to do whatever needs doing by itself).
> >
> > fork and exit;
> > open STDERR, ">>log/whatever";
> > close STDOUT;
> > #do whatever needs to be done;
>
> Yup, beat me to it! I haven't got time to play with it now but what about
> a system call, that 's based on a fork with nested exec as I recall. If
> I'm wrong feel free to flame me!
There are some (potential) problems with just using system.
If the parent doesn't close STDERR and STDOUT until after the "system"
then it doesn't release the browser, so there is no point in doing it that
way (unless it puts child in background).
If the parent closes STDERR and STDOUT before calling system, then there is
a chance that Apache will clobber the parent after the "close"s but before
the "system", and therefore "system" never gets called. If the parent does
make it to the "system" before getting clobbered, I don't know what will
happen when it does get clobbered. Sometimes it seems like a child also
dies if it is still associated with the parent when the parent gets
clobbered.
If you system to put the child in the background (system "foo.pl&" on
unix), and then closes STDOUT and STDERR after that, that is probably
immune from both of the above paragraphs.
Xho
--
--------------------
http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB