SpanMode uses incorrect terminology (breadth)

Jesse Phillips jessekphillips+D at gmail.com
Sun Sep 16 22:30:50 PDT 2012


> What would be an example illustrating that "breadth" is doing 
> the wrong thing?
>
> Andrei

Linux 64bit:

import std.file;
import std.stdio;

void main() {
     mkdir("a");
     mkdir("a/b");
     mkdir("a/c");
     mkdir("a/c/z");
     std.file.write("a/1.txt", "");
     std.file.write("a/2.txt", "");
     std.file.write("a/b/1.txt", "");
     std.file.write("a/b/2.txt", "");
     std.file.write("a/c/1.txt", "");
     std.file.write("a/c/z/1.txt", "");
     foreach(string file; dirEntries("a/", SpanMode.breadth))
         writeln(file);

     rmdirRecurse("a");
     // Expected Approximation
     // a/2.txt
     // a/1.txt
     // a/b
     // a/c
     // a/c/1.txt
     // a/c/z
     // a/c/z/1.txt
     // a/b/1.txt
     // a/b/2.txt
     //
     // Actual
     // a/c
     // a/c/z
     // a/c/z/1.txt
     // a/c/1.txt
     // a/b
     // a/b/2.txt
     // a/b/1.txt
     // a/2.txt
     // a/1.txt
}



More information about the Digitalmars-d mailing list