Fsdb::Support::NamedTmpfile - dreate temporary files that can be opened
use Fsdb::Support::NamedTmpfile; $pathname = Fsdb::Support::NamedTmpfile::alloc($tmpdir);
$pathname = Fsdb::Support::NamedTmpfile::alloc($tmpdir);
Create a unique filename for temporary data. $TMPDIR is optional. The file is automatically removed on program exit, but the pathname exists for the duration of execution (and can be opened).
Note that there is a potential race condition between when we pick the file and when the caller opens it, when an external program could intercede. The caller therefor should open files with exclusive access.
This routine is Perl thread-safe, and process fork safe. (Files are only cleaned up by the process that creates them.)
While this routine is basically "new", we don't call it such because we do not return an object.
cleanup one tmpfile, forgetting about it if necessary.
Cleanup all tmpfiles Not a method.