This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/21471] New: 'POSITION = "APPEND"' doesn't seem to work


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]