pub fn files_from_subdir(
current_path: &Path,
scan_subdirs: bool,
) -> Result<Vec<PathBuf>>Expand description
Returns all files in a directory, optionally scanning subdirectories recursively.
§Arguments
current_path- The directory to scanscan_subdirs- Iftrue, recursively scans subdirectories; iffalse, only scans the top level
§Returns
Returns a vector of paths to all files found, or an error if the directory cannot be read.
§Examples
// Get only files in the current directory
let files = files_from_subdir(Path::new("./data"), false)?;
// Get all files recursively
let all_files = files_from_subdir(Path::new("./data"), true)?;