RSS | Module Info | Add a review of File-Temp

8 out of 8 found this review helpful:

File-Temp (0.16) ****

I have used File::Temp extensively in the test suites of my CPAN modules ExtUtils::ModuleMaker and ExtUtils::ModuleMaker::PBP and will use it directly in a module to come, File::Save::Home. I strongly advocate its use in any situation where you are testing code for the creation of files and directories. All such tests should take place in a temporary directory functioning as a sandbox, and that temporary directory and its contents should be removed when the test has been completed.

My only quibble with File::Temp is that, having used the object-oriented interface and gotten accustomed to having my tempfiles be deleted when the object goes out of scope, I long for the same facility with respect to tempdirs. As of v0.16, 'tempdir' is available only through the functional interface and you must explicitly call CLEANUP => 1 to get the tempdirs so created deleted at the end of the *program*. I would love to have a function/method that automatically deletes tempdirs at the end of their *enclosing scope/block*. This would, for example, enable me to create a tempdir within a block, test for its existence, have the tempdir deleted automatically when the block is closed, then test again for its non-existence.

This wish aside, kudos to Tim Jenness for both writing File::Temp and, even more importantly, maintaining it over the years.

James E Keenan - 2005-11-12 10:44:56
Was this review helpful to you?  Yes No

7 out of 7 found this review helpful:

File-Temp (0.16) ****

I'll say up front that one of two of the interface decisions in File::Temp bug me. Some things are given confusingly-similar names, and then there's CLEANUP => 1. In the end, though, these minor quibbles are overshadowed by the incredible usefulness of self-destroying files and directories. My test scripts abound with File::Temp use; make a directory, go hog wild making files in it, and when you're done it goes away. Dump logs into tmpfiles for analysis. Later on they're gone. Totally freaking awesome.

Ricardo SIGNES - 2005-11-04 18:36:50
Was this review helpful to you?  Yes No

4 out of 5 found this review helpful:

File-Temp (0.15) ****

A great module for regular use - if you need to save a temporary file, use File::Temp. It saves a lot of time and effort, and tries to make sure the temporary file is as safe as possible.

Pete Birkinshaw - 2005-02-22 13:27:09
Was this review helpful to you?  Yes No

4 out of 4 found this review helpful:

File-Temp (0.16) ****

File::Temp is temporary file handling done right. It takes care of all the annoying bits that make dealing with temporary files a hassle. In particular, I find temporary files indispensable for atomic writing to data files that might be opened by other (less careful) processes.

The interface of File::Temp is a bit odd. KEY => value pairs in all caps don't feel natural to me and a couple of for historic reasons differently named functions doing basically the same thing aren't at the height of interfaces in my opinion.

I would be able to do the temporary file handling without the module pretty well, but it would cost me significantly more thought. But just a few years ago, I mightn't have known about all the weird things that can happen to a simple-minded approach. So: (File::Temp)++

Steffen Müller - 2004-07-14 04:17:17
Was this review helpful to you?  Yes No

2 out of 2 found this review helpful:

File-Temp (0.14) *****

This module seems to do what it claims: create temporary directories and files and clean them up when the program is done, without having to do any book-keeping.

It's very easy to use.

Robert Rothenberg - 2004-07-13 09:07:14
Was this review helpful to you?  Yes No

0 out of 13 found this review helpful:

File-Temp (0.14) ***

wodcleaningservice.com

residential & commercial

carpet cleaning

wax floors

Brockton, MA 02301

tel: 508-583-1757

agidio baptista - 2004-06-21 07:19:14
Was this review helpful to you?  Yes No

8 out of 8 found this review helpful:

File-Temp (0.14) ****

Nice and easy to use. I love the fact that it supports any implementation and any programming style you might fancy. Only drawback is that the docs look a bit "scary" at first contact. Maybe include more basic examples at the top like:

($fh, $filename)=tempfile();

With no parameters. Simple. Vanilla. No Sprinkles, whipped cream or chocolate syrup.

Issac Goldstand - 2004-01-27 13:37:27
Was this review helpful to you?  Yes No


the camel