This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fortran standard question: open()


I have noticed a difference between the HP Fortran compiler and gfortran
and was wondering if someone familiar with the Fortran standard could
tell me if this is a bug or just an implementation difference.

If we have the following program:

      OPEN(10,FILE='wup.in',STATUS='OLD')
      CLOSE(10, STATUS='KEEP')
      END

And a data file that is readable by everyone and writable by nobody:

$ ll wup.in
-r--r--r--   1 sje        other             0 Nov 24 08:43 wup.in


Then when I use the HP compiler to build the program it runs fine, but
if I use gfortran, it fails.  Obviously gfortran is trying to open the
file for reading and writing (since I didn't specify) and the open is
failing.  If I give myself write permssion to the file, the gfortran
compiled program runs fine.

Is this a compiler bug?

Steve Ellcey
sje@cup.hp.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]