DMD 2.060, Windows 7 64-bit

Source:

import std.file;
import std.stdio;

void main()
{
    foreach (DirEntry d; dirEntries("C:\\", SpanMode.breadth))
        writeln(d.name);
}

This code stops with "std.file.FileException@std\file.d(2434): C:\Documents and Settings: Access is denied." when it gets to C:\Documents and Settings. On Windows 7 that doesn't actually exist, which is fine. What I'd like it to do is tell me that it doesn't exist, but continue iterating anyway. I've tried try-catch, but that just stops the iteration.

Any help is appreciated. Thanks :)

Josh

Reply via email to