[Issue 10240] It should be possible to check exists and isDir/isFile with a single stat call

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 5 08:28:47 UTC 2017


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

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
There are 2 ways to solve this:

1. Either check that the file or directory exists inside the isDir/isFile
functions and return false if the path does not exist or the input string
doesn't designate a directory/file. This is troublesome since you have one
value for 2 different semantics.

2. Create a function existsAndIsDir/File where you can call stat a single time.
This means adding 2 new functions that add no extra functionality for the
benefit of a micro-optimization.

In my opinion we should close this as WONTFIX.

--


More information about the Digitalmars-d-bugs mailing list