iterate over a directory, dealing with permission errors

Mike Parker aldacron at gmail.com
Sun May 23 15:12:22 UTC 2021


On Sunday, 23 May 2021 at 14:33:10 UTC, xray wrote:
> On Sunday, 23 May 2021 at 14:03:19 UTC, Mike Parker wrote:
>> On Sunday, 23 May 2021 at 13:29:26 UTC, xray wrote:
>>> On Friday, 18 September 2015 at 13:53:45 UTC, Meta wrote:

> Thanks Mike. Now I have a
> "The error handler's return value(DirEntry) does not have a 
> common type with the expression(DirIterator)."

Well, the post you initially replied to did say this:

> Although I'm not exactly sure what to return for the "error" 
> value... I'm not sure if DirEntry.init will work or not; you'll 
> probably have to mess around with it.

It's not something I've had to look into before, so I have 
nothing useful for you at the moment.

>
> So I removed the ifThrown for while and it compiles....but 
> still doesn't work because of an access denied file 
> (FileException).
>
> I thought the exception will be caught be the closure.

Are you calling it with `RangePrimitive.pop` or 
`RangePrimitive.popFront`?


More information about the Digitalmars-d mailing list