}

fn set_datastreams_directory(path: &PathBuf) {
    let mut lock = DATASTREAMS_DIRECTORY.write().unwrap();
    *lock = Some(path.clone().into_boxed_path());
}

pub fn valid_source_directory(path: &Path) -> Result<(), String> {
    fn valid_directory(path: &Path) -> Result<(), String> {
        if path.is_dir() {
            Ok(())
        } else {
            Err(format!("The directory '{}' does not exist", path.display()))
        }
    }