forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

INQUIRE: rules of engagement

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Thu Oct 12, 2006 8:12 am    Post subject: INQUIRE: rules of engagement Reply with quote

As the result of a bout of getting some code working under WinXP that previously ran fine under Win2k, I find myself wondering where the "rules of engagement" for INQUIRE are to be found. Even "FORTRAN 90 explained" is less than forthcoming on the subject.

The curiosity started when I (inadvertently) INQUIREd about the existence of a file for which I had provided a file spec that was a blank string. Careless, admittedly - but I think I might have expected to get a simple "does not exist" response rather than the run-time error I actually got, which declared I had passed an illegal file name. Prompting the question ... how many rules there are to be broken, and what they are.

This got me wondering how much interpretation of the file spec goes on behind the scenes, and where it is documented, and how the statement copes with different OSs. Related to this is whether there is a standard way to INQUIRE about the existence of a path rather than a file. I have been trying the old method of appending "." to the path I want to enquire about, and it returns false whether the path exists or not. I suspect (but cannot currently demonstrate) that it would have worked under Win9x - in which case, the rules of engagement that I can't find are system-dependent as well.
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Thu Oct 12, 2006 10:13 am    Post subject: INQUIRE: rules of engagement Reply with quote

Andy

Part of the answer to test if a path exists could be to use ATTACH@ and check the error return.
Back to top
View user's profile Send private message AIM Address
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Thu Oct 12, 2006 10:32 am    Post subject: INQUIRE: rules of engagement Reply with quote

Hmm. Not used attach@ before - actually,. t seems that fexists@ gives the right answer if supplied with a syntactically valid path (although there's no clear reason to expect this from the documentation).

What about the rules of engagement for INQUIRE, and the run-time error?
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Fri Oct 13, 2006 4:42 am    Post subject: INQUIRE: rules of engagement Reply with quote

Andy

If you do not have access to a copy of the Fortran 90 standard, the Fortran 77 standard will probably suffice and can be found at http://www.fortran.com/F77_std/f77_std.html

The runtime error is almost certainly a bug in FTN95.

Back to top
View user's profile Send private message AIM Address
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Fri Oct 13, 2006 9:04 am    Post subject: INQUIRE: rules of engagement Reply with quote

Thanks, Paul - I'll check it out.
Back to top
View user's profile Send private message Send e-mail
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Fri Oct 13, 2006 10:06 am    Post subject: INQUIRE: rules of engagement Reply with quote

OK, in one sense the answer's pretty clear. The standard says:

"The value of fin___ must be of a form acceptable to the processor as a file name."

But that leaves open the question of whether an unacceptable value should be handled by iostat or the runtime library.

Andy
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group