1 2 3 4 5 6 7 8 9 10 11 12
use std::path::Path; use anyhow::Result; use tokio::fs; pub async fn create_parent_directories(path: &Path) -> Result<()> { if let Some(parent) = path.parent() { fs::create_dir_all(parent).await?; } Ok(()) }