- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The inquire is being done on a FOLDER intead of a file and so it's always failing in IVF 9.0 (returns .FALSE. instead of .TRUE. if the folder exists).
Now the IVF 9.0 help is written a little different from the CVF help because it states that it not only exists, but also can be opened, and true, a folder cannot be opened.
Is there a work around for this. In the actual code, the filespec is in a variable, and may be either a file or folder and is used as a partial filespec while composing the full file spec. It is necessary to be able to check for existance only at the point in the code that has the INQUIRE, not whether or not it can be opened.
Thanks, Jim
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
INQUIRE (DIRSPEC='', EXIST=LEXIST)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks again, Steve
However, I need to now point out that the new option is DIRECTORY= instead of DIRSPEC=
I was able to fix the problem routine by adding another 22 INQUIRE statements inside IFDEF's so they only get included if using your compilier. My code is generic and the INQUIRE statements are using a character string for the path name which may be either a file or a directory, so I still have to do the INQUIRE for FILE= and then if that comes back .FALSE. then I have to repeat the same INQUIRE, but now with DIRECTORY=. There are a total of 22 INQUIRE statements within the routine that keep futzing with the path name and then trying to check for existance. They do things like translate environment variables embedded within the path spec and trying both upper and lower case versions of the name and trying different file extensions (I also support unix systems with this code). Well, now I have 44 INQUIRE statements in the routine, but it's working again!!! I was a little dissappointed to have found it necessary to make such a change, but I also understand the reasons for wanting to test if a file can be opened rather than existing, however, that should have been done with adding a new output attribute such as OPENABLE=variable instead of changing the behaviour of EXIST=variable which by name implies that you are only checking for existance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My apologizes on DIRSPEC - that keyword exists but is an output value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Imagine my delight while attempting to regression test some of our applications with IVF 9.1 when that which had been working with IVF 8.1.30 no longer did. ;-)
Is this a standards interpretation issue? From deep in the belly of the beast emerges the following snippet:
INQUIRE ( FILE=cCDdriveLtr//':.',EXIST=lCDonline )
IF ( lCDonline ) THEN
cVolumeLabel = A1230_VolumeLabel( cCDdriveLtr//":" )
lCDmountIncomplete = .FALSE.
EXIT
END IF
Should there be an agenda other than to change it?
Thanks
Ron Guenther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code you have is undefined by the standard. The standard says "The value of file-name-expr in the FILE= specifier specifies the name of the file being inquired about." A directory/folder is not a file. If it worked for you before, it was by luck and not design. You should change the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings Steve,
Absolutely correct assumption! From W_FC_C_9[1].0.019.exe. The last working but undefined code was in w_fc_pc_8[1].1.030.exe.
Thanks for your timely response. BTW, are you aware of a "Fortran standard solution" for determining when removeable media are mounted now?
- 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
!DEC$ IF DEFINED (__INTEL_COMPILER) INQUIRE ( DIRECTORY=cCDdriveLtr//':.', EXIST=lDTED_CDonline ) !DEC$ ELSE INQUIRE ( FILE=cCDdriveLtr//':.', EXIST=lDTED_CDonline ) !DEC$ ENDIF

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page