FileException Inconsistency?
Alex
alexander.edwards at gmail.com
Tue May 12 04:06:26 UTC 2026
On Monday, 11 May 2026 at 16:00:23 UTC, Nick Treleaven wrote:
> On Monday, 11 May 2026 at 15:52:11 UTC, Nick Treleaven wrote:
>> So if you are correct (sorry I don't have Windows to hand to
>> test), possibly there is a compiler bug. Can you try to come
>> up with a minimal example that triggers the bug?
>
> Another thing to try is removing the `catch(Throwable)` part.
> That is for advanced use only AIUI. What happens then?
Hi,
If I remove the catch(Throwable) the program crashes, which is
why I added it in the first place :)
If I put a try {} around the dirEntries() aswell that does seem
to catch FileException reliably. I wonder if the Exception
handling is being affected by the laziness of the dirEntries to
some extent.
I'm still surprised this FileException is only being caught as a
Throwable in this case.
I'm not sure I can create a much more simple example to test.
Though "scanning" the C:\ProgramData\ directory and looking out
for the Packages subdirectory should trigger the problem. I'll
have a bit more of a go.
Thanks
More information about the Digitalmars-d-learn
mailing list