Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Re: How to dete...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 18 Topic 8229 of 8775
Post > Topic >>

Re: How to determine whether or not there exists a directory

by ziven <zuoweizhang@[EMAIL PROTECTED] > May 13, 2008 at 06:03 PM

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
 




 18 Posts in Topic:
How to determine whether or not there exists a directory
ziven <zuoweizhang@[EM  2008-05-13 02:26:53 
Re: How to determine whether or not there exists a directory
Terence <tbwright@[EMA  2008-05-13 02:42:19 
Re: How to determine whether or not there exists a directory
Steve Lionel <Steve.Li  2008-05-13 09:36:24 
Re: How to determine whether or not there exists a directory
Ron Ford <ron@[EMAIL P  2008-05-13 18:21:49 
Re: How to determine whether or not there exists a directory
glen herrmannsfeldt <g  2008-05-13 16:20:56 
Re: How to determine whether or not there exists a directory
Arjen Markus <arjen.ma  2008-05-13 07:23:39 
Re: How to determine whether or not there exists a directory
Reinhold Bader <Bader@  2008-05-13 16:32:33 
Re: How to determine whether or not there exists a directory
Terence <tbwright@[EMA  2008-05-13 16:40:41 
Re: How to determine whether or not there exists a directory
Ron Ford <ron@[EMAIL P  2008-05-13 21:05:17 
Re: How to determine whether or not there exists a directory
ziven <zuoweizhang@[EM  2008-05-13 18:03:44 
Re: How to determine whether or not there exists a directory
Catherine Rees Lay <ca  2008-05-14 09:39:25 
Re: How to determine whether or not there exists a directory
relaxmike <michael.bau  2008-05-14 02:50:21 
Re: How to determine whether or not there exists a directory
ziven <zuoweizhang@[EM  2008-05-14 07:39:20 
Re: How to determine whether or not there exists a directory
Steve Lionel <Steve.Li  2008-05-14 13:47:54 
Re: How to determine whether or not there exists a directory
"David Jones" &  2008-05-14 16:53:07 
Re: How to determine whether or not there exists a directory
Steve Lionel <Steve.Li  2008-05-14 13:48:37 
Re: How to determine whether or not there exists a directory
Terence <tbwright@[EMA  2008-05-14 21:24:34 
Re: How to determine whether or not there exists a directory
Terence <tbwright@[EMA  2008-05-14 21:32:33 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 3:24:14 CDT 2008.