[Issue 12391] DirEntries throws in foreach

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 23 15:55:31 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=12391

Chris Katko <ckatko at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ckatko at gmail.com

--- Comment #8 from Chris Katko <ckatko at gmail.com> ---
This issue from 2014 is still not resolved?

The function as-is, is completely broken (and nearly useless) if it cannot
handle a simple permissions issue. That means every single program using this
function is subject to breaking if a file/folder with inaccessible permissions
is placed in a desired search directory. Even if you catch exceptions overall,
it's still going to terminate the loop from searching, breaking whatever file
listing the program depended on. 

And even if that was acceptable, it's still not documented that this happens.

This definitely needs addressed as it's a fundamental building block of D's
standard library. You are basically expected to use this for any enumerated
file access.

--


More information about the Digitalmars-d-bugs mailing list