Setup local dirs by creating one new dir in each of the given dirs
(local_dirs: &[PathBuf])
| 458 | |
| 459 | /// Setup local dirs by creating one new dir in each of the given dirs |
| 460 | fn create_local_dirs(local_dirs: &[PathBuf]) -> Result<Vec<Arc<TempDir>>> { |
| 461 | local_dirs |
| 462 | .iter() |
| 463 | .map(|root| { |
| 464 | if !Path::new(root).exists() { |
| 465 | std::fs::create_dir(root)?; |
| 466 | } |
| 467 | Builder::new() |
| 468 | .prefix("datafusion-") |
| 469 | .tempdir_in(root) |
| 470 | .map_err(DataFusionError::IoError) |
| 471 | }) |
| 472 | .map(|result| result.map(Arc::new)) |
| 473 | .collect() |
| 474 | } |
| 475 | |
| 476 | #[cfg(test)] |
| 477 | mod tests { |