develooper Front page | perl.perl5.porters | Postings from November 1999

Re: Unlink Failure in t/parsefile.t

Gisle Aas
November 11, 1999 06:04
Re: Unlink Failure in t/parsefile.t
Message ID:
The following program fails with perl5.005_03 on Win32-systems because
the file handle will not be closed before unlink() is called.  I have
verified that the close(2) call also is missing on Linux (with strace).
In perl5.005_62 I don't see this problem.  What patch did fix this?

Are there any plans for a 5.005_04?


print "1..1\n";

my $file = "foo$$.bar";

use Symbol qw(gensym);

my $f = gensym();

open($f, ">$file") || die "Can't create $file: $!";
foo(*$f);   # calling it as foo($f) is ok

unless (unlink($file)) {
    warn "Can't unlink $file: $!";
    print "not ";

print "ok 1\n";

sub foo {
    my $x = shift;
    print $x "Foo\n";
} Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About