Path.walk

Iterate over all files and directories inside path;

struct Path
const
walk
(
SpanMode mode = SpanMode.shallow
,
bool followSymlink = true
)

Parameters

mode SpanMode

The way to traverse directories. See docs

do we need to follow symlinks of not. By default set to True.

Examples

// Iterate over paths in current directory
foreach (Path p; Path(".").walk(SpanMode.breadth)) {
    if (p.isFile) writeln(p);

Meta