pub fn scan_files<P: AsRef<Path> + Sync>(
roots: &[P],
recursive: bool,
exts: &[&str],
) -> Result<Vec<PathBuf>, String>Expand description
Scan folder(s) for files matching extensions. Uses jwalk for parallel recursive scanning.
§Arguments
roots- Directory or directories to scanrecursive- Scan subdirectoriesexts- File extensions or glob patterns (e.g., &[“mp4”, “jp*”, “tif?”])
§Example
ⓘ
let videos = scan_files(&["/media"], true, &["mp4", "mov", "avi"])?;
let images = scan_files(&["/renders"], false, &["exr", "jp*"])?; // jpg, jpeg, jp2...
let all = scan_files(&["/data"], true, &[])?; // all files