unlink1#
Unlink a temporary file. Upstream closes $fh first; here the filehandle is left open and closed by its usual refcount path.
Synopsis#
unlink1($fh, $path) or die "unlink1: $!";
What you get back#
Integer 1 on success.
Examples#
use File::Temp qw/ tempfile unlink1 /;
my ($fh, $path) = tempfile();
## ... use $fh ...
unlink1($fh, $path);
Edge cases#
$File::Temp::KEEP_ALL = 1suppresses removal.Fewer than two arguments: no-op, returns
1.
Differences from 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.
See also#
unlink0— unlink-while-open variant.cleanup— bulk removal of registered entries.