Subject: | suggest PREFIX option |
Date: | Wed, 16 Sep 2009 09:31:22 +1000 |
To: | bug-File-Temp [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
It'd be good if File::Temp had a PREFIX option like
$fh = File::Temp->new (PREFIX => 'myprog');
which would generate a file "/tmp/myprogXXXXXX".
Emacs make-temp-file has this and it's a good way to work a program name
or module name into the filename, as a hint at who's to blame for
filling up /tmp. :-)
I got the effect I wanted with a TEMPLATE, but that then needs TMPDIR
turned on explicitly, and in any case I'd rather let File::Temp decide
how many "XXXXXX"s are prudent etc.
$fh = File::Temp->new (TEMPLATE => 'myprog-XXXXXX',
TMPDIR => 1);
--
Advertising jargon elucidated for the layman:
"Gadget" - any product which by definition you'll buy then never use.