CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   append data to a file (

Wen Long April 11, 2002 18:00

append data to a file
Dear firends:

I got a problem with appending data to a existing file, how should I do with Fortran 77?

I'm using linux redhat 6.0, f77 as complier.

I wrote:


open(1,file='test.txt',status='old',position='appe nd')

write(1,*)'this is appended data'

write(1,*)'this is again appended data' close(1)



but it doesn't recognize 'append',

what's wrong?

Thanks for helping me out.


FYW April 11, 2002 20:45

Re: append data to a file
try this... and make sure you do not use a rewind statement otherwise it will go back to the start of the file and effectively cancel the append command.

open(1,file='test.txt',status='unknown', access='append')

All times are GMT -4. The time now is 09:29.