findFiles

Find files in the specified directory

InputRange!DirEntry
findFiles

Parameters

rofs ReadOnlyFileSystem

filesystem to scan

baseDir string

path to the base directory (if empty, defaults to current working directory)

recursive bool

if true, the search will recurse into subdirectories

Examples

void listImagesInDirectory(ReadOnlyFileSystem fs, string baseDir = "")
{
    foreach (entry; fs.findFiles(baseDir, true)
            .filter!(entry => entry.isFile)
            .filter!(entry => !matchFirst(entry.name, `.*\.(gif|jpg|png)$`).empty))
    {
        writefln("%s", entry.name);
    }
}

Meta