1Fsdb::Support::NamedTmpUfsielre(C3o)ntributed Perl DocumFesndtba:t:iSounpport::NamedTmpfile(3)
2
3
4
6 Fsdb::Support::NamedTmpfile - dreate temporary files that can be opened
7
9 use Fsdb::Support::NamedTmpfile;
10 $pathname = Fsdb::Support::NamedTmpfile::alloc($tmpdir);
11
13 alloc
14 $pathname = Fsdb::Support::NamedTmpfile::alloc($tmpdir);
15
16 Create a unique filename for temporary data. $TMPDIR is optional. The
17 file is automatically removed on program exit, but the pathname exists
18 for the duration of execution (and can be opened).
19
20 Note that there is a potential race condition between when we pick the
21 file and when the caller opens it, when an external program could
22 intercede. The caller therefor should open files with exclusive
23 access.
24
25 This routine is Perl thread-safe, and process fork safe. (Files are
26 only cleaned up by the process that creates them.)
27
28 While this routine is basically "new", we don't call it such because we
29 do not return an object.
30
31 cleanup_one
32 Fsdb::Support::NamedTmpfile::cleanup_one('some_filename');
33
34 cleanup one tmpfile, forgetting about it if necessary.
35
36 cleanup_all
37 Fsdb::Support::NamedTmpfile::cleanup_all
38
39 Cleanup all tmpfiles Not a method.
40
41
42
43perl v5.36.0 2023-01-20 Fsdb::Support::NamedTmpfile(3)