This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
writing over an existing file
- From: Philippe Depondt <dep at ccr dot jussieu dot fr>
- To: gfortran <fortran at gcc dot gnu dot org>, bdavis at gfortran dot org
- Date: Tue, 08 Feb 2005 13:30:39 +0100
- Subject: writing over an existing file
- Reply-to: dep at ccr dot jussieu dot fr
The following code
program wtest
implicit none
open(1,file='wtest.out')
write(1,'("1 2 3 4 5 6 7 8 9")')
close(1)
open(1,file='wtest.out')
write(1,'("9 8 7 6")')
close(1)
end
compiled with:
gfortran -ffree-form -O3 wtest.f -o wtest
puts in file wtest.out the following content:
9 8 7 6
5 6 7 8 9
whereas
g77 -ffree-form -O3 wtest.f -o wtest
yields
9 8 7 6
as it should.
Weird...
This is using the Linux binaries.
Philippe Depondt dep@ccr.jussieu.fr
# INSP Institut des Nano-Sciences de Paris
# Universite P. et M. Curie, Casier 86, 140 rue de Lourmel 75015 Paris
# Site Boucicaut : Bat. 2, 1er etage piece 4 Tel: 01 44 27 42 33