mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
This type helps to perform atomic operations by writing to a temporary file and renaming it to the actual filename when the `AtomicFile::finish` function is called. If the `AtomicFile::finish` function is never called, the temporary file is automatically removed when it goes out of scope. It utilizes the `renameat2` [1] libc function and its semantics. [1] https://man7.org/linux/man-pages/man2/renameat.2.html Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>