[Issue 889] New: listdir loops forever

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 26 00:51:06 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=889

           Summary: listdir loops forever
           Product: DGCC aka GDC
           Version: 0.21
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos
        AssignedTo: dvdfrdmn at users.sf.net
        ReportedBy: digitalmars-com at baysmith.com


This example is from http://www.digitalmars.com/d/phobos/std_file.html under
docs for "void listdir(char[] pathname, bool delegate(DirEntry * de)
callback);"

 import std.stdio;
 import std.file;

 void main(char[][] args)
 {
    bool callback(DirEntry* de)
    {
      if (de.isdir)
        listdir(de.name, &callback);
      else
        writefln(de.name);
      return true;
    }

    listdir(args[1], &callback);
 }


-- 



More information about the D.gnu mailing list