The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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.