pub fn write_atomic_new(path: &Path, bytes: &[u8]) -> Result<()>Expand description
Atomically and durably create path with bytes, failing with
std::io::ErrorKind::AlreadyExists if the destination already exists.
This follows the same temp-file + file-fsync + parent-fsync sequence as
write_atomic, but installs the temp file with hard_link(temp, path)
instead of rename(temp, path). Hard-link creation is resolved atomically by
the OS and refuses an existing destination, so concurrent creators for the
same path produce exactly one winner and AlreadyExists for the rest. The
temporary link is removed after the destination link is established.