David Cantrell wrote:
On Tue, Jun 17, 2008 at 09:40:02PM -0400, David Golden wrote:

There also seem to be some things in ~/tmp/
That's on linux.  It's worse on Win32.  Lots of stuff winds up dumped
in c:\.  In one case, I think there were several thousand tiny
directories.

On *nix I periodically clean out several hundred files from /tmp.
I assume that they're created by File::Temp.


In the course of my testing of Parrot's configuration and build tools, I have had *many* occasions to create temporary files and directories. At one point last year I got complaints. We found that code like this did the trick:

use File::Temp qw( tempdir tempfile );
my $tdir = tempdir( CLEANUP => 1 );
my ( $tmpfile, $fname ) = tempfile( UNLINK => 1 );

Since these are functions from a core module, there is no excuse for any CPAN author not to use them with these cleanup options. (I'd say that proper cleanup of temp files created during testing should be a 'kwalitee' metric -- but I don't want to get into that argument!)

Jim Keenan

Reply via email to