pub fn write_file(path: &Path, content: &str) -> Result<()>
Write content to a file, creating parent directories if needed