NAME

Fsdb::Support::NamedTmpfile - dreate temporary files that can be opened

SYNOPSIS

See Fsdb::Support::NamedTmpfile::new

FUNCTIONS

alloc

$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 interceed. The caller therefor should open files with exclusive access.

This routine is Perl thread-save.

While this routine is basically "new", we don't call it such because we do not return an object.

cleanup_one

Fsdb::Support::NamedTmpfile::cleanup_one('some_filename');

cleanup one tmpfile, forgetting about it if necessary.

cleanup_all

Fsdb::Support::NamedTmpfile::cleanup_all

Cleanup all tmpfiles Not a method.

cleanup_signal

cleanup tmpfiles after a signal. Not a method.