Take a look at the CopyFile( $src, $dst, $fileIfExists ) api in Win32API::File. The third parameter decides whether it will overwrite or fail if the file exists.
That probably won't help if the existing file is set readonly, but if you use the native api your likely to get more rational behaviour with respect to file permissions. Ie. If the source is not readonly, the destination won't.
You can use Win32::File to obtain and change the files attributes.
In reply to Re: clobbering files with File::Copy
by BrowserUk
in thread clobbering files with File::Copy
by the_muffin_man
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |