Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: fork & END

by tlm (Prior)
on Sep 07, 2005 at 01:12 UTC ( [id://489735]=note: print w/replies, xml ) Need Help??


in reply to Re: fork & END
in thread fork & END

Thanks.

Are you on Win32? File::Temp claims that it doesn't unlink things in child processes...

I'm having a hard time locating this in the docs. Grepping "child" got me nothing. What should I search for? (FWIW, I'm using version 5.8.6 of Perl, and version 0.14 of File::Temp.)

My OS is Linux.

The problem I'm having results from the CLEANUP option of File::Temp::tempdir, which I'm setting to 1.

I guess I was wondering if there was a standard workaround for this kind of situation.

the lowliest monk

Replies are listed 'Best First'.
Re^3: fork & END
by xdg (Monsignor) on Sep 07, 2005 at 02:02 UTC

    I think you may want to upgrade. See the ChangeLog for File::Temp. 0.15 improved forking support. If you look at the CPAN docs, there's a brief comment in a section at the very end called "forking".

    In writing File::pushd, I didn't set CLEANUP and used File::Path to remove the directory precisely when I wanted to (in my case, earlier than END). You could do that in your parent process after you reap all the children. But I'd try your script with a newer version of File::Temp and see if that resolves things for you.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://489735]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-18 02:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found