Fortran inquire file
Skip Knoble, Penn State - - I'd like to find a way to check if a directory exists I was - working with the inquire command but it appears that I can only use - that for files.
Is there a command to test if a directory exists and - if so, what is it? Herman D. Thanks for you help! I'd like to find a way to cycle through them, check if they exist and delete them if they do.
The big issue I'm running into is that I don't know how to pass a variable into the call system command can I even? Also, I am using Lahey LF95 as my compiler. Any help would be greatly appreciated!! Originally posted by Herman D. All variants of the system subroutine or function it is never a "command" take a character expression as an arguments. That character expresssion can be a variable or any other character expression - nothing special about it.
Inquire by file allows one to ask: is a given file connected to any unit, and if so, to which unit? If the file is not connected then unit will be -1 , otherwise unit will correspond to the unit connected to the file.
Alternatively, depending on what you want to do with the open statement, it isn't necessarily erroneous to open with an already connected file. Testing this variable against the desired filename when it is undefined is bad.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow.
Learn more. Check whether file has been opened already Ask Question. Asked 6 years, 5 months ago. Anyway its not a big deal just a curiosity. The Fortran standard does not even have the concept of a directory and Fortran has been implemented on systems that don't have such a thing , so it says nothing about it.
As I recall, the C standard is actually quite simillar in not having such a concept. Sure there are widely used C libraries that do, but I don't recall that it was directly in the C standard. So I may or may not have had some tiny influence on it being changed don't know, assume it would take lots of complaints or some other serious reason to change it.
This was supposed to return a. But this may be platform dependent. Note: this is a memory, which may be wrong. I personally use non-portable methods myself.. Digital Marketing Skills. Human Resources Skills. Health Care Skills. Finance Skills. All Courses. All Practice Tests. Fortran Tutorial. Job Recommendation Latest. Jobs in Meghalaya Jobs in Shillong. View All Locations.
0コメント