Bug 11631 – std.file.rename doesn't work across different mount points

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2013-11-28T07:05:50Z
Last change time
2019-11-18T18:23:28Z
Assigned to
No Owner
Creator
Artem Tarasov

Comments

Comment #0 by lomereiter — 2013-11-28T07:05:50Z
man 2 rename / ERRORS / EXDEV For this reason Python users use shutil.move instead of os.rename.
Comment #1 by bugzilla — 2019-11-18T16:05:58Z
Comment #2 by dlang-bugzilla — 2019-11-18T18:23:28Z
Having the operation be atomic and NOT copy the file contents is a desirable property in many circumstances. As such, this is not a bug. Adding std.file.move which tries rename and falls back to copy would be a reasonable enhancement, though.