FileScan

This module is deprecated because it doesn't support file globbing or regexes for matching files and because it ignores folders that it doesn't recurse into (a non-recursive scan will never return any folders).

Recursively scan files and directories, adding filtered files to an output structure as we go. This can be used to produce a list of subdirectories and the files contained therein. The following example lists all files with suffix ".d" located via the current directory, along with the folders containing them:

auto scan = new FileScan;

scan (".", ".d");

Stdout.formatln ("{} Folders", scan.folders.length);
foreach (folder; scan.folders)
         Stdout.formatln ("{}", folder);

Stdout.formatln ("\n{} Files", scan.files.length);
foreach (file; scan.files)
         Stdout.formatln ("{}", file);

This is unlikely the most efficient method to scan a vast number of files, but operates in a convenient manner.

Members

Aliases

Filter
alias Filter = FilePath.Filter

Alias for Filter delegate. Accepts a FilePath & a bool as arguments and returns a bool.

opCall
alias opCall = sweep
Undocumented in source.

Functions

errors
const(char)[][] errors()

Return all the errors found in the last scan

files
FilePath[] files()

Return all the files found in the last scan

folders
FilePath[] folders()

Return all directories found in the last scan

sweep
FileScan sweep(const(char)[] path, bool recurse)

Sweep a set of files and directories from the given parent path, with no filtering applied

sweep
FileScan sweep(const(char)[] path, const(char)[] match, bool recurse)

Sweep a set of files and directories from the given parent path, where the files are filtered by the given suffix

sweep
FileScan sweep(const(char)[] path, Filter filter, bool recurse)

Sweep a set of files and directories from the given parent path, where the files are filtered by the provided delegate

Variables

errorSet
const(char)[][] errorSet;
Undocumented in source.
fileSet
FilePath[] fileSet;
Undocumented in source.
folderSet
FilePath[] folderSet;
Undocumented in source.

Meta