http://www.perlmonks.org?node_id=227507


in reply to Re: File::Copy dying on Win2k when target file already there
in thread File::Copy dying on Win2k when target file already there

Very sorry about the confusion. I had a little bit of a versioning problem. I modified the error message line after I pasted in the code for the script to get a more informative error message, and forgot to fix the code. The modified line looks like this:
copy($localfile, $installfile) or die "$localfile unable to copy to $installfile : $!\n";

That said, demerphq helped me track down the problem. The problematic files where read-only, and apparently File::Copy won't let you copy over read-only files (even if you are the Administrator). I modified the code to add lines like this:

fixreadonly($plugindir) if $^O =~ /win32/i; sub fixreadonly { my $dir = shift; my $unsetreadonly = Bio::Root::IO->catfile( $dir, "*.*"); system("attrib -r /s $unsetreadonly"); }

Scott
Project coordinator of the Generic Model Organism Database Project