From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25136 invoked by alias); 16 Nov 2001 21:06:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25109 invoked by uid 71); 16 Nov 2001 21:06:02 -0000 Date: Mon, 05 Nov 2001 15:39:00 -0000 Message-ID: <20011116210601.25107.qmail@sourceware.cygnus.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Youngjean Jung Subject: Re: fortran/4885: BACKSPACE example that doesn't work as of gcc/g77-3.0.x Reply-To: Youngjean Jung X-SW-Source: 2001-11/txt/msg00145.txt.bz2 List-Id: The following reply was made to PR fortran/4885; it has been noted by GNATS. From: Youngjean Jung To: Toon Moene Cc: Youngjean Jung , Tim Prince , gcc-gnats@gcc.gnu.org Subject: Re: fortran/4885: BACKSPACE example that doesn't work as of gcc/g77-3.0.x Date: Fri, 16 Nov 2001 12:56:07 -0800 This is a multi-part message in MIME format. --------------010709020609050205090709 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Dear Mr. Toon Moene : Don't you have any gabage letters in s2.dat? Youngjean Toon Moene wrote: >Youngjean Jung wrote: > >>I conducted many tests on the Endfile, Backspace commands. They don't >>work in the following senses: >> >>1) Endfile command writes meaningless letters on the data file. >>2) Endfile, Backspace combination doesn't make a 'backspace job'. >> > >> program test >>c >> implicit none >> integer i,k >>c >> do i=1,10 >> open(1,file='s2.dat',status='unknown',access='sequential') >> do k=10,20 >> write(1,*) i,k >> endfile 1 >> backspace 1 >> end do >> close(1) >> end do >>c >> end >> > >Hmmm, I get the same s2.dat as you get (Debian GNU/Linux 2.2, >gcc/g77-3.0.2): > >toon@laptop:~/g77-bugs$ cat s2.dat > 10 10 > 10 11 > 10 12 > 10 13 > 10 14 > 10 15 > 10 16 > 10 17 > 10 18 > 10 19 > 10 20 > >This seems to be in accordance with the Standard: > >12.10.4.1 BACKSPACE Statement. > >Execution of a BACKSPACE statement causes the file connected to the >specified unit to be positioned before the preceding record. If there is >no preceding record, the position of the file is not changed. Note that >if the preceding record is an endfile record, the file becomes >positioned before the endfile record. > >In other words, your backspace only backspaces over the endfile record >(as per the standard). If you want to backspace over the record you >just wrote, you have to backspace twice. > >[Tim - does this mean I can close fortran/4885 ? Thanks] > --------------010709020609050205090709 Content-Type: application/octet-stream; name="s2.dat" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="s2.dat" IDEwIDEwCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAIDEwIDExCiAxMCAxMgogMTAgMTMKIDEwIDE0CiAxMCAxNQogMTAgMTYKIDEwIDE3 CiAxMCAxOAogMTAgMTkKIDEwIDIwCg== --------------010709020609050205090709--