pub fn ensure_directory_exists(path: &Path) -> Result<()>
Ensures a directory exists, creating it if necessary