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