On 4/10/12, Dmitry Olshansky <[email protected]> wrote:
> Wake up! dirEntries produce a lazy _range_ and it's not opApply

Sorry? Change DirIterator in std.file to this:
http://pastebin.com/DHvXuFeH

test.d:
import std.file;

bool isEmptyDir(string path)
{
    foreach (string name; dirEntries(path, SpanMode.shallow))
        return false;

    return true;
}

void main()
{
    isEmptyDir(".");
}

$ rdmd test.d
> we're in oppapply

Reply via email to