I didn't test it, but the destination file opening line in that module is:
open($to_h,"> $to\0") or goto fail_open2;
so it should override the file ...
Enjoy,
Mickey
| [reply] [d/l] |
dear monks,
copy("c:\\dir1\\text.errmsg", "c:\\dir2\\text.errmsg") || die "Can't open text.errmsg:$!";
when i ran the program, it creates the file and copied the content. next time i ran the program (destination file is existing now ) it is giving error message. Normally it should overwrite it ,but it is not happening here.. can u explain in detail??
| [reply] [d/l] |
unlink $destfile if -f $destfile;
copy($origfile, $destfile);
Update: This is a workaround. As mickeyn said at Re: help needed in File::copy, File::Copy should overwrite destination file.
Igor 'izut' Sutton
your code, your rules.
| [reply] [d/l] [select] |
If I understand properly, you should check the file permissions after it got created the first time. It is probably set to read-only for user. See the umask function for details.-imran | [reply] |