Open jacobwilliams opened 4 years ago
I think that the first bullet point here deserves to be considered as a language feature, rather than something to be implemented in stdlib.
As far as I know, there is no way to detect directories. inquire(file=...)
works in GNU and a few other compilers, but not in Intel. inquire(directory=...)
works for Intel, but directory
is a non-standard extension. I don't know of any other alternatives.
I don't really see how this can be solved in stdlib without going through C interfaces to stat
.
At minimum, I think that directory=
or dir=
or whatever could be introduced as a standard argument to inquire
, and indicate invalid results if the filesystem happens to not support directories.
Or maybe there is some way to have file=
work for directories without breaking precedent?
I've always considered it a major defect of Fortran that it doesn't seem to know anything about directories or the file system. I think some people consider this a feature of sorts, but it's hard to imagine nowadays any complicated program that doesn't need to know about these things. So we all resort to compiler extensions (e.g. Intel's portability library is great) or hand-rolled hacks or platform-specific system calls. It would be nice if a lot of this was standardized. Just of few of the things we need:
open
and thenclose(..status='delete')
but that is just so non-modern).Having these standardized so they will work on all platforms and with all compilers would be a big improvement over the current situation.