Atomic Directory Commits
Sometimes you need to "commit" a directory to target location atomically. That is you don't want to have a partial directory where only a subset of files is stored.
Being able to atomically commit a directory relies on 2 conditions:
- Having an atomic rename operation where the source and target is on the same filesystem device.
- Being able to create a temporary directory descriptor similar to a temporary file descriptor.