Fsdb::S...dTmpfile(3)

πŸ“¦
version 3.9 Β· 3 versions
, in epel 9

πŸ’– NAME πŸ’–

okay so bestie, this is the User Contributed Perl Documentation page for Fsdb::S...dTmpfile(3), and the whole vibe is Fsdb::Support::NamedTmpfile β€” literally all about dreate temporary files that can be opened. Yes, dreate. We move. πŸ’…


✨ SYNOPSIS ✨

use Fsdb::Support::NamedTmpfile;
$pathname = Fsdb::Support::NamedTmpfile::alloc($tmpdir);

🌸 FUNCTIONS 🌸

πŸ¦‹ alloc πŸ¦‹

$pathname = Fsdb::Support::NamedTmpfile::alloc($tmpdir);

Create a unique filename for temporary data. $TMPDIR is optional, bestie. The file is automatically removed on program exit, but the pathname exists for the duration of execution β€” and yes, it can be opened. 🫢

⚠️ real talk: there is a potential race condition between when we pick the file and when the caller opens it, because an external program could intercede. The caller therefor should open files with exclusive access. no cap.

This routine is Perl thread-safe and process fork safe. (Files are only cleaned up by the process that creates them.) 🧚

Even though this routine is basically "new", we don't call it such because we do not return an object. no object, no new, periodt. πŸ’€

🧹 cleanup_one 🧹

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

This one cleanups one tmpfile, forgetting about it if necessary. πŸŽ€

🧼 cleanup_all 🧼

Fsdb::Support::NamedTmpfile::cleanup_all

Cleanup all tmpfiles. Not a method β€” bestie, do not come for her with method energy. πŸ™ˆ


k bye bestie πŸ’– this iconic little page is from perl v5.32.1, dated 2024-08-02, and it lives under Fsdb::S...dTmpfile(3) β€” mwah πŸ’…βœ¨

πŸ“¦ where this page comes from