unlink1#
Unlink a temporary file. Upstream closes $fh first; here the filehandle is left open and closed by its usual refcount path.
תקציר#
unlink1($fh, $path) or die "unlink1: $!";
מה מוחזר#
Integer 1 on success.
דוגמאות#
use File::Temp qw/ tempfile unlink1 /;
my ($fh, $path) = tempfile();
## ... use $fh ...
unlink1($fh, $path);
מקרי קצה#
$File::Temp::KEEP_ALL = 1suppresses removal.Fewer than two arguments: no-op, returns
1.
הבדלים מן ה-upstream#
Upstream closes
$fhexplicitly before unlinking. This implementation relies on perl5 refcount-driven close instead, so callers wanting an immediatecloseshould do it themselves before the call. Covered byt/81-xs-native/File-Temp/*.t.
ראו גם#
unlink0- unlink-while-open variant.cleanup- bulk removal of registered entries.