This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: gfortran.dg/pr16597.f90 leaves behind a file (bug?)
- From: Bud Davis <bdavis9659 at sbcglobal dot net>
- To: FX Coudert <fxcoudert at gmail dot com>, "Kaveh R. Ghazi" <ghazi at caipclassic dot rutgers dot edu>
- Cc: bdavis9659 at sbcglobal dot net, fortran at gcc dot gnu dot org
- Date: Wed, 22 Mar 2006 16:30:36 -0800 (PST)
- Subject: Re: gfortran.dg/pr16597.f90 leaves behind a file (bug?)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=sbcglobal.net; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ltnE6rrVklHGQDdS5ZlFlcoXxGb1TXSpqCIQHZ6MsyR4fpIbNNn5snQ3GQbaNp17D6MjAo3/JF8xgFo3H9cduf2UCLUUOBzgBY3T+FL3XMfw1IJ3vybRz3G7CUhBKl6Bv7AISZAJibwHB+ipdXmZnX9mrEpRVolsx8Hsy0dxFRg= ;
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
>