pub fn write_text_atomic(path: &Path, content: &str) -> Result<()>
Write to a temp file in the same directory, then rename for atomicity.