Function findFiles
Find files in the specified directory
std .range .interfaces .InputRange!(dlib.filesystem.filesystem.DirEntry) findFiles
(
ReadOnlyFileSystem rofs,
string baseDir,
bool recursive
);
Parameters
Name | Description |
---|---|
rofs | filesystem to scan |
baseDir | path to the base directory (if empty, defaults to current working directory) |
recursive | 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);
}
}