STINNER Victor <vstin...@python.org> added the comment:

It's nice if os.rename() can be atomic. It can be atomic if it is implemented 
as a single syscall and the source and the destination are on the same 
filesystem.

If we modify the implement to check if src and/or dst is a hardlink, we will 
need more syscalls which cannot be atomic. What if another process replaces src 
or dst before or after the rename() syscall?

I suggest to document the issue. Or maybe we need a new flavor which keeps the 
current behavior.

"Atomic write" is an old topic and no one managed to implement it in a portable 
way. So maybe you can ignore the atomicity constraint.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue21876>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to