Subject: | Win32 compatibility PATCH |
Hi,
please find enclosed simple patch that fixes a failing test
t/SeqFeature/SeqFeatCollection.t when installing Bio::Perl on
Win32/strawberry.
The problem was that File::Temp->new() (called in sub test_output_file)
returns an open filehandle to temporary file and it is still open even
after return from sub test_output_file. You later in the code unlink
this tempfile; however Windows do not allow unlinking an open filehandle
- and it was the cause of the problems.
So I simply close the temporary filehandle and left the created tempfile
on the filesystem (you are handling keeping/deleting these files yourself).
--
kmx
--- BioPerl-1.6.0/Bio/Root/Test.pm
+++ BioPerl-1.6.0patched/Bio/Root/Test.pm
@@ -299,10 +299,12 @@
sub test_output_file {
die "test_output_file takes no args\n" if @_;
- my $tmp = File::Temp->new();
+ my $tmp = File::Temp->new(UNLINK => 0);
push(@TEMP_FILES, $tmp);
+ my $fname = $tmp->filename;
+ close($tmp);
- return $tmp->filename;
+ return $fname;
}