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

FX Coudert fxcoudert@gmail.com
Wed Mar 22 23:57:00 GMT 2006


> 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



More information about the Fortran mailing list