https://issues.dlang.org/show_bug.cgi?id=6138
Francesco Galla' <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #5 from Francesco Galla' <[email protected]> --- (In reply to RazvanN from comment #3) > After analyzing the code I see that dirEntries does not call absolutePath on > the path, which in my opinion is a bug. Even though I cannot reproduce the > bug, I think a call to absolutePath should definitely be added I reproduced the bug with the following code: foreach (string entry; dirEntries((dir), SpanMode.shallow)) { if (entry.isDir) { foreach (string subentry; dirEntries(entry, SpanMode.shallow)) { if (subentry.isDir) { chdir(absolutePath(subentry)); writeln (absolutePath(subentry)); } } } } My directory tree is: . ├── 1 │ └── 2 ├── 3 │ ├── 4 │ └── 5 │ └── 6 * The result I obtained was the following: std.file.FileException@/opt/dmd-2.075/import/std/file.d(1631): ./3: No such file or directory * By calling: foreach (string entry; dirEntries(absolutePath(dir), SpanMode.shallow)) The code was executed correctly. This seems to confirm the need for dirEntries() to call absolutePath(). Am I mistaken? --
