Message406482
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. |
|
Date |
User |
Action |
Args |
2021-11-17 18:12:35 | vstinner | set | recipients:
+ vstinner, r.david.murray, Esa.Peuha, Aaron.Swan |
2021-11-17 18:12:35 | vstinner | set | messageid: <1637172755.85.0.188440274827.issue21876@roundup.psfhosted.org> |
2021-11-17 18:12:35 | vstinner | link | issue21876 messages |
2021-11-17 18:12:35 | vstinner | create | |
|