- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using fortran version 8 for linux and have a question about the results from the inquire statement. I'm porting code and the code does an inquire with file = to a directory name. The result for exist is false even though the directory exists. I wrote a small test program and confirmed the behavior. Is there a way to get inquire to recognize a directory as a file for the purpose of testing existence?
Tom
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Existing directories are not recognized by the FORTRAN-INQUIRE-Statement using the so called file inquiry. The returned value of the EXIST specifier is always ".false.", even if the directory exists. According to the description the output value should be ".true.".
Other Compilers and History:
All other F77/F90 compilers in use - and all Fortran Compilers before - on the other platforms return the value ".true." - according to the f95 standard. Besides:pgf90 Portland Compiler on Linux returns also ".true.". Andalso the father of the Intel ifort compiler on WindowsXP (Digital- COMPAQ) returns the value ".true.".
That is the truth. The standard document for INQUIRE EXIST specifier tells about files in total nothing about limitation to regular files.
The hint of Steve to ifort 9 release notes: we think that it is no solution to fuse some new incompatible specifiers (DIRECTORY and DIRSPEC) to the INQUIRE statement. We ask you and intel to satisfy the meaning of the standard for in this point and to make a cahnge according to the remark oftwlaub from 2006-01-11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, it looks like the new standards still avoid dealing with directories due to OS-dependence. Maybe one could convince other compiler vendors to implement Intel's INQUIRE extensions.
![](/skins/images/895D6060305DF45A57FACF854B5A8CD1/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page