diff --git a/datman/src/tree.rs b/datman/src/tree.rs index e8ae5eb..dd20d8d 100644 --- a/datman/src/tree.rs +++ b/datman/src/tree.rs @@ -316,6 +316,15 @@ pub fn scan_with_progress_bar( for entry in dir_read? { let entry: DirEntry = entry?; + + if entry.file_name() == ".datmanskip" { + // Directories with .datmanskip in them are to be skipped entirely. + // TODO(perf): should this be checked upfront before some children may already + // have been scanned? + debug!("Skipping {path:?} because it has a .datmanskip file."); + return Ok(None); + } + let scanned = scan_with_progress_bar(&entry.path(), progress_bar, one_filesystem, exclusions)?; if let Some(scanned) = scanned {