Net::SFTP::do_rename() fails if the file I am renaming to already exists
Is that so? If that's the case, then file a bug report.
Renaming to a file that already exists is not an error, indeed, the POSIX rename function mandates that at all points in time, a file named 'file' will always exist, even in the event of a system crash at the point in time when the system rename call is in progress. Depending on the exact point in time you ask for the file, you might get the old one, or the new one, but you are guaranteed that you will get one of them. Break that, and you break a lot of things.
Wietse Venema reminded me of this point on the Postfix Users mailing list just yesterday :)
- another intruder with the mooring in the heart of the Perl
In reply to Re: Net::SFTP atomic updates?
by grinder
in thread Net::SFTP atomic updates?
by ctilmes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |