pub async fn write_file(path: &str, content: &str) -> Result<String, AppError>
Write to a file asynchronously.