Speeding up DCD in big projects

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jul 21 20:14:53 UTC 2020


On Tue, Jul 21, 2020 at 07:24:19PM +0000, WebFreak001 via Digitalmars-d wrote:
> On Tuesday, 21 July 2020 at 19:03:05 UTC, H. S. Teoh wrote:
[...]
> > There is the workaround of writing:
> > 
> > 	if (f.exists && f.isDir) ...
> > 
> > but it's ugly and involves an extra unnecessary syscall roundtrip.
> > 
> > Basically, this kind of API design is just hideous. I propose we
> > remove the throw from isDir/isFile.
[...]
> don't do this, this introduces a race condition (and is the reason why
> this was a function using try-catch in the first place)

Yet another reason isDir should not throw!


T

-- 
Never ascribe to malice that which is adequately explained by incompetence. -- Napoleon Bonaparte


More information about the Digitalmars-d mailing list