[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 09:47:27 UTC 2017


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

ZombineDev <petar.p.kirov at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |petar.p.kirov at gmail.com

--- Comment #2 from ZombineDev <petar.p.kirov at gmail.com> ---
I believe the right solution add a function akin to C++17's file_status
(http://en.cppreference.com/w/cpp/experimental/fs/file_status) which would
return a struct essentially being union of

https://msdn.microsoft.com/en-us/library/windows/desktop/aa364946(v=vs.85).aspx
on Windows

and 

http://pubs.opengroup.org/onlinepubs/009695399/functions/stat.html on Posix.

That way users would be to obtain more information in a single call.

Unfortunately we have all kinds of functions defined in
https://dlang.org/phobos-prerelease/std_file General, Attributes, Timestamp

while a single function returning a struct would be much more useful.

--


More information about the Digitalmars-d-bugs mailing list