isDir won't throw FileException with dirEntries

Nick Treleaven nospam at example.com
Tue Aug 30 11:02:43 PDT 2011


On 30/08/2011 18:54, Jonathan M Davis wrote:
> On Tuesday, August 30, 2011 10:39 Nick Treleaven wrote:
>> Hi,
>> With the attached source file on Windows, dmd 2.054, I'm not getting an
>> exception when the path doesn't exist. If I uncomment the foreach line,
>> the exception is thrown. Should I file this in bugzilla?
>
> So, what exactly is the problem? Is the issue that isDir isn't throwing or
> that dirEntries isn't throwing? isDir should definitely throw if the path
> doesn't exist, but I'm not sure that dirEntries will.

The problem is that isDir doesn't throw - the documentation says:
"Throws: FileException if the given file does not exist. "

If I remove the foreach/dirEntries then isDir does throw.


More information about the Digitalmars-d-learn mailing list