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]

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


i was wrong.  the second open does in fact open a file
in /tmp  ( strace is my friend !).

it also looks like the test case doesn't test what it
should have tested, or the implementation of scratch
files has changed along the way. or it was just plain
wrong (very possible, given who the author was )

i vote to remove the following lines from the test and
call it a day:

+      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


--bud



--- FX Coudert <fxcoudert@gmail.com> wrote:

> > Err, but it does.  There are two open/close pairs,
> the second one
> > opens fort.99 with STATUS='SCRATCH'.  Perhaps I'm
> exposing my neophyte
> > fortran i/o skills, but shouldn't that cause
> fort.99 to be deleted
> > when the file is closed?
> 
> The second OPEN has a STATUS="SCRATCH", so it will
> not open fort.99 but 
> instead, create a temporary file with a unique name
> (most probably in 
> /tmp) which will then be removed upon calling close.
> 
> The two OPEN statements in the testcase open two
> different files, the 
> first named "fort.99" which is not removed, and
> should not be, and the 
> second a scratch file, which is removed afterwards.
> The testcase behaves 
> as it is supposed to, and you can see that both
> Intel and g77 compilers 
> have this exact same behaviour.
> 
> FX
> 


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