http://d.puremagic.com/issues/show_bug.cgi?id=4006
Summary: dirEntries won't span subdirectories
Product: D
Version: 2.041
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
--- Comment #0 from Jesse Phillips <[email protected]> 2010-03-25
19:43:25 PDT ---
The code below creates the folders and file Hello/there/you it then checks that
that string appears in on of the names returned when using dirEntries. The
result is that the loop is never given that filename.
-----------------------
import std.file;
import std.regex;
void main() {
auto all = ["Hello",
"Hello/there"];
foreach(dir; all) {
mkdir(dir);
}
write(all[1] ~ "/you", "Make me feel");
assert(exists(all[1] ~ "/you"), "you don't exist");
scope(exit) {
remove(all[1] ~ "/you");
foreach(dir; all)
if(exists(dir))
rmdirRecurse(dir);
}
bool found = false;
foreach(string name; dirEntries(".", SpanMode.depth)) {
if(!match(name, regex(all[1] ~ "/you")).empty)
found = true;
}
assert(found, "Missing File");
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------