[std.file] dirEntries

Vladimir Panteleev vladimir at thecybershadow.net
Mon Dec 12 11:14:07 PST 2011


On Monday, 12 December 2011 at 14:43:38 UTC, Tobias Pankrath 
wrote:
> I can't see, what I'am doing wrong. Can anyone help?

You can't do this only using a glob. The glob syntax used by 
dirEntries is described here:

http://dlang.org/phobos/std_path.html#globMatch

You can do this with std.algorithm.filter: auto files = filter!
    q{a.name.startsWith("temp_") && !a.name.canFind('.')}
    (dirEntries("myDir", SpanMode.breadth));

foreach (de; files)
    writeln(de.name);



More information about the Digitalmars-d-learn mailing list