atomic_json_write

Function atomic_json_write 

Source
pub async fn atomic_json_write(
    base_dir: &Path,
    filename: &str,
    content: &str,
) -> Result<(), Error>
Expand description

Atomic JSON write: write to tmp file, fsync, then rename into place.

If the target already exists and rename fails with AlreadyExists, falls back to remove-then-rename (for non-POSIX platforms).