It is not possible to do a simple iteration over directories in @safe mode. Really? I have to resort to unsafe?? //---- module test; @safe: // nope. no can do. import std; void main() { auto dFiles = dirEntries("", "*.{d,di}", SpanMode.depth); foreach(d; dFiles) writeln(d.name); } //----