Inconsitancies with 'INQUIRE'
Tobias Burnus
burnus@net-b.de
Tue Oct 24 13:18:00 GMT 2006
Hi,
Philippe Schaffnit schrieb:
> I get: 'F NO UNKNOWN'
>
Well, the output is ok, if the file does not exists. Could you re-check
that the file indeed exists?
> I do not object to getting 'UNKNOWN', but I consistantly get that my
> files are unreadable and unformatted in the unreduced code...
>
Can you add a
write(*,'(3a)') 'Filename:',trim(filename),':'
call system('pwd')
call system('ls -l '//filename)
call system('file '//filename)
into the code just before or after the inquire? Only to make sure that
the file indeed exists, has the assumed permissions, and that you
inquire the file you want to check. I'm also curious what "file" prints:
"empty", "data" or "ASCII text" or ...?
I find it very surprising that you get formatted == "NO" as I get
"YES" even for unformatted files.
> This would be too un-reliable to use, then?
>
So far I found that gfortran's return value for "read" and "write" are
ok, but ifort and NAG f95 do write always "UNKNOWN" unless the file is
already corrected.
Thus I regard the "write" and "read" checks as useless and only use the
"exist" check.
* * *
I fail to create a test case, which shows your problem. As said, I only
found problems with formatted (filled as bug 29578):
The formatted check returns always "YES" unless the file does not exists
("UNKNOWN"). This is specially true for:
- if the file is unformatted (even if it is still open, that check
should be trivial) or
- if the file is not readable.
In the first case it should be "YES" (at least if opened) or "UNKNOWN"
(but not if opened),
in the second case it should be "UNKNOWN".
Tobias
More information about the Fortran
mailing list