gfortran.dg/pr16597.f90 leaves behind a file (bug?)

Kaveh R. Ghazi ghazi@caipclassic.rutgers.edu
Wed Mar 22 12:38:00 GMT 2006


The testcase gfortran.dg/pr16597.f90 leaves behind a "fort.99" file.
The last open statement uses STATUS='scratch', so my limited
fortran-speak tells me the temp file should be deleted but it's not.
Also adding status='delete' to the last close statement has no effect.

Is it a bug, or am I missing something?

		Thanks,
		--Kaveh


! { dg-do run }
! pr 16597
! libgfortran
! reading a direct access record after it was written did
! not always return the correct data.

      program gfbug4
      implicit none

      integer      strlen
      parameter    (strlen = 4)

      integer      iunit 
      character    string *4

      iunit = 99
      open (UNIT=iunit,FORM='unformatted',ACCESS='direct',RECL=strlen)
      write (iunit, rec=1) 'ABCD'
      read (iunit, rec=1) string
      close (iunit)
      if (string.ne.'ABCD') call abort

      open (UNIT=iunit,FORM='unformatted',ACCESS='direct',STATUS='scratch',RECL=strlen)
      write (iunit, rec=1) 'ABCD'
      read (iunit, rec=1) string
      close (iunit)
      if (string.ne.'ABCD') call abort
      end



More information about the Fortran mailing list