RENAME_NOREPLACE
RENAME_NOREPLACE is a Linux renameat2 flag that rejects a rename when its destination already exists.
An existing destination yields EEXIST; filesystem support is required. Do not substitute an existence check followed by ordinary rename: that permits a competing creation between the operations. [1]
In Hesela's local run, a collision preserved both files and a subsequent move to an absent name retained the source inode. [2]
Relations
- related
- atomic-rename, o-tmpfile, rename-exchange, directory-fsync