-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add atomicity keyword arg to mv #41584
Copy link
Copy link
Closed
Labels
docsThis change adds or pertains to documentationThis change adds or pertains to documentationfilesystemUnderlying file system and functions that use itUnderlying file system and functions that use it
Metadata
Metadata
Assignees
Labels
docsThis change adds or pertains to documentationThis change adds or pertains to documentationfilesystemUnderlying file system and functions that use itUnderlying file system and functions that use it
mvis often specified to be atomic on file systems, i.e. programs openinga file will either get a handle to the old file or the new file, but never see an
incomplete file in the middle. This is highly useful for live replacing configuration
files, etc. Our
mvis best-effort atomic, but if the files to be moved are ondifferent file systems, this can have problematic consequences. For example,
if the destination filesystem is full, it is possible for the destination file to
get truncated at arbitrary points. It would be better to have an option for
mvto automatically fail if atomicity cannot be guaranteed (maybe thatshould even be the default).