writing over an existing file

Philippe Depondt dep@ccr.jussieu.fr
Tue Feb 8 12:51:00 GMT 2005



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



More information about the Fortran mailing list