public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/21471] New: 'POSITION = "APPEND"' doesn't seem to work
@ 2005-05-09 14:50 P dot Schaffnit at access dot rwth-aachen dot de
  2005-05-09 17:21 ` [Bug libfortran/21471] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: P dot Schaffnit at access dot rwth-aachen dot de @ 2005-05-09 14:50 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-05-11  7:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-09 14:50 [Bug fortran/21471] New: 'POSITION = "APPEND"' doesn't seem to work P dot Schaffnit at access dot rwth-aachen dot de
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

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).