Marcello has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I have the following code:
BTW, I also write an entry in the logfile is the removal of the directory fails, this is also not the case, so it looks like it never reaches the code in the child process.
Can it be that although $pid is defined, the fork() fails? And how can I catch still situation in the above code?
Any input is highly appreciated
As I see it, the newly created directory should always be removed. But sometimes the directory is mysteriously still there, without any fork() errors in my logfile.# create new directory here if (($pid = fork()) == 0) { # remove directory here } if (!defined($pid)) { # log fork() failure here # remove directory here }
BTW, I also write an entry in the logfile is the removal of the directory fails, this is also not the case, so it looks like it never reaches the code in the child process.
Can it be that although $pid is defined, the fork() fails? And how can I catch still situation in the above code?
Any input is highly appreciated
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: mysterious fork() failure
by dws (Chancellor) on Jan 05, 2002 at 01:11 UTC | |
by Marcello (Hermit) on Jan 05, 2002 at 02:02 UTC | |
Re: mysterious fork() failure
by Zaxo (Archbishop) on Jan 05, 2002 at 03:51 UTC | |
by fokat (Deacon) on Jan 05, 2002 at 23:23 UTC |
Back to
Seekers of Perl Wisdom