public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "P dot Schaffnit at access dot rwth-aachen dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/21471] New: 'POSITION = "APPEND"' doesn't seem to work
Date: Mon, 09 May 2005 14:50:00 -0000	[thread overview]
Message-ID: <20050509144956.21471.P.Schaffnit@access.rwth-aachen.de> (raw)

Hi!

I am under the impression that the gfortran compiler doesn't (at least in some
cases) handle well the "APPEND" file access, and rather overwrites the contents
of the file...

Can you help me with that?

Thanks!

Philippe


PS: gfortran -vUsing built-in specs.
Target: i686-pc-linux-gnu
Configured with:
/USER/philippe/Irix/Compilation/gcc/Sources/Release_4_0_0/gcc/configure
--prefix=/usr1/MICRESS/Philippe/Tools/Gcc
--with-mpfr=/usr1/MICRESS/Philippe/Tools/Mpfr
--with-gmp=/usr1/MICRESS/Philippe/Tools/Gmp
Thread model: posix
gcc version 4.1.0 20050503 (experimental)

PPS: the command I use to run this test:
gfortran --static -o Hello_World Hello_World.f90 ; rm -f File ; touch File ;
./Hello_World ; cat File

PPPS: a small example I put together: "File" should contains 13 times
Hello_World, but in fact only has the last one
!======================================================================!
! **********************************************************************
! *								       *
! *			       T e s t  			       *
! *								       *
! **********************************************************************
!======================================================================!
!
!======================================================================!
! Declaration
!======================================================================!
!
      PROGRAM Test
!
      INTEGER    ::   Counter
!
      CHARACTER ( LEN = 250 ), PARAMETER    ::   String = "Hello world!"
!
!======================================================================!
! Begin
!======================================================================!
!
!
      WRITE ( 6, "(/A)" ) "Beginning of screen output"
      DO Counter = 1, 13
         OPEN ( UNIT = 13, FILE = "File", FORM = "FORMATTED",          &
     &                             POSITION = "APPEND", STATUS = "OLD" )
         WRITE ( UNIT = 13, FMT = "(A,I5)" ) TRIM(String), Counter
         CLOSE ( UNIT = 13 )
         WRITE ( 6, "(A,I3)" ) TRIM(String), Counter
      END DO
      WRITE ( 6, "(A/)" ) "End of screen output"
!
!
!======================================================================!
!     End
!======================================================================!
      END PROGRAM Test

-- 
           Summary: 'POSITION = "APPEND"' doesn't seem to work
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: P dot Schaffnit at access dot rwth-aachen dot de
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21471


             reply	other threads:[~2005-05-09 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09 14:50 P dot Schaffnit at access dot rwth-aachen dot de [this message]
2005-05-09 17:21 ` [Bug libfortran/21471] " pinskia at gcc dot gnu dot org
2005-05-10 10:26 ` fxcoudert at gcc dot gnu dot org
2005-05-11  5:56 ` cvs-commit at gcc dot gnu dot org
2005-05-11  5:57 ` cvs-commit at gcc dot gnu dot org
2005-05-11  7:24 ` fxcoudert at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050509144956.21471.P.Schaffnit@access.rwth-aachen.de \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).