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 = 1 suppresses removal.

  • Fewer than two arguments: no-op, returns 1.

Διαφορές από το upstream#

  • Upstream closes $fh explicitly before unlinking. This implementation relies on perl5 refcount-driven close instead, so callers wanting an immediate close should do it themselves before the call. Covered by t/81-xs-native/File-Temp/*.t.

Δείτε επίσης#

  • unlink0 - unlink-while-open variant.

  • cleanup - bulk removal of registered entries.