It seems to be compiler-dependent.
On linux the Code below yields:
1) T F F F with ifort 10.1 20070913;
2) T T F F with gcc 4.1.2 20070502;
3) T T F F with gcc 3.2.3 20030502;
4) T T F F with pgf90 5.1-6
But the "(directory).nul" suggested by Terenc didn't work.
BTW, Steve mentioned "Intel Fortran added INQUIRE keywords to provide
for asking about
directories".
Any detail info about this?
---
program main
LOGICAL :: exist1, exist2, exist3, exist4
INQUIRE (FILE="results001/hillary1.jpg",EXIST=exist1)
INQUIRE (FILE="results001",EXIST=exist2)
INQUIRE (FILE="results001/hillary1.jpg.nul",EXIST=exist3)
INQUIRE (FILE="results001.nul",EXIST=exist4)
print *, exist1, exist2, exist3, exist4
end
On May 13, 9:36 pm, Steve Lionel <Steve.Lio...@[EMAIL PROTECTED]
> wrote:
> On Tue, 13 May 2008 02:42:19 -0700 (PDT), Terence <tbwri...@[EMAIL PROTECTED]
>
wrote:
> >You just use INQUIRE to test for the existence of the file
> >(directory).nul to find if the directory named (directory) exists.
>
> This is not ****table across operating systems. In particular on
Windows, you
> cannot inquire about a directory as if it were a file.
>
> As defined in the standard, INQUIRE is for files and its effect when
used on
> directories is implementation-dependent. Some implementations allow you
to
> name a directory in a file-based INQUIRE and return meaningful results,
some
> don't. Intel Fortran added INQUIRE keywords to provide for asking about
> directories.
> --
> Steve Lionel
> Developer Products Division
> Intel Cor****ation
> Nashua, NH


|