CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   append data to a file (https://www.cfd-online.com/Forums/main/4624-append-data-file.html)

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:

c-------------

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)

end

c--------------

but it doesn't recognize 'append',

what's wrong?

Thanks for helping me out.

Wen

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 05:00.