Arch::TempFiles(3pm) | User Contributed Perl Documentation | Arch::TempFiles(3pm) |
Arch::TempFiles - help to manage temporary files/dirs
use Arch::TempFiles qw(temp_file_name temp_file temp_dir); # all will be removed automatically on the script completion my $file_name1 = temp_file(); my $file_name2 = temp_file_name("status"); my $dir_name = temp_dir("arch-tree"); use Arch::TempFiles; my $tmp = new Arch::TempFiles; $tmp->root($tmp->dir); my $file_name = $tmp->name; open OUT, ">$file_name"; close OUT;
This module deals with temporary file names. It is similar to File::Temp, but simplier and more focused. Also, File::Temp is relatively new and was not shipped with older perl versions.
Both function interface and object oriented interface are supported.
The following functions are available:
temp_root, temp_name, temp_file_name, temp_dir_name, temp_file, temp_dir.
The corresponding class methods are available too:
root, name, file_name, dir_name, file, dir.
Please note, that the operation of acquiring the file name using this function/method and actual creating of this file is not atomic. So you may need to call this method again if the creation is failed, for example if some other process created the same file in the middle.
Awaiting for your reports.
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
For a different interface, see File::Temp.
2005-04-22 | perl v5.20.2 |