Skip to content
8 changes: 8 additions & 0 deletions std/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -4783,6 +4783,8 @@ if (__traits(compiles, { DirEntry entry; bool _ = pred(entry); }))

bool mayStepIn()
{
if (!pred(_cur))
return false;
return _followSymlink ? _cur.isDir : attrIsDir(_cur.linkAttributes);
}
}
Expand Down Expand Up @@ -5198,6 +5200,12 @@ if (__traits(compiles, { DirEntry entry; bool _ = pred(entry); }))
sort(result);

assert(equal(files, result));

import std.algorithm : endsWith;
auto result2 = dirEntries!((scope ref DirEntry entry) => entry.name.endsWith("Hello World"))(dir, SpanMode.shallow).map!((return a) => a.name.normalize()).array();
import std.stdio;
writeln(result2);
assert(result2.length == 1);
}

// https://issues.dlang.org/show_bug.cgi?id=21250
Expand Down