mktemp#
Fill in the trailing Xs of a template and return the resulting filename - does not create the file.
Σύνοψη#
my $name = mktemp('/tmp/dataXXXXXX');
Τι επιστρέφεται#
A candidate filename string with random characters substituted for the trailing Xs. No file is created; the caller must open it themselves and accept the race between naming and opening.
Παραδείγματα#
use File::Temp qw/ mktemp /;
my $name = mktemp('/var/tmp/snapXXXXXXXX');
Οριακές περιπτώσεις#
Template with fewer than four trailing
Xs: croaks.Wrong arg count: croaks with a usage message.
Unsafe against racing attackers - prefer
tempfile.
Διαφορές από το upstream#
Fully compatible with upstream File::Temp 0.2312.
Δείτε επίσης#
tempfile- race-safe replacement.mkstemp- same idea, but also creates and opens the file.tempnam-dir + prefixvariant.