Print

Print


I thought that by having the IOSTAT=error_condition,
I would detect whether I'm opening a file that does not exist.

Apparently I was wrong.

In my code, I have :

open( unit=...., ..., IOSTAT=error_condition)
if ( error_condition == 0 )
   ! read the file
   ...
end if

it appears that even though the file does not exist, I get 
error_condition = 0,
and the my reading of the files fails.

I have the same behaviour with 3 different compilers ( IBM, SUN and 
Compaq/TRU64).
I searched the F95 standard, but it does not say explicitly (or not
explicitly enough for me) whether opening a non-existing file should
be an error.
Does anybody ahve the final word about that?

B. Meltz 

****************************************
*                                      *
*  Bertrand Meltz                      *
*  CEA / Bruyeres-le Chatel            *
*  BP 12                               *
*  91680 Bruyeres-le-Chatel            *
*  FRANCE                              *
*                                      *
*  Tel : (33) [0] 1 69 26 57 83        *
*  Fax : (33) [0] I 69 26 73 84        *
*                                      *
*  e_mail : [log in to unmask]      *
*                                      *
****************************************


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%