How to append to a file

Hi all. I am trying to append to a file. I use f.SEEK(f.LEN) to move the pointer to the end of the file. When I try to write somthing in use of f.WRITE(somthing) after f.SEEK(f.LEN) I have a error message say ‘The operating system cannot gain access to the file.’. From the debugger I can see the file is opened and the length of file is found which is 1010 and the current position is 1010. How can I move the pointer to next position? I tried f.SEEK(f.LEN+1) and it didn’t work. Same error message popped up. Thanks

Hi April! Have you set File.WRITEMODE(TRUE) ? Also, File.TEXTMODE(TRUE) ? Regards, Jörg

Maybe file has read-only attribute [:D] -

Well, it looks like no one has idea how to do it?

For some reasons I can’t see the reply on my computer. Perhaps I deleted all cookies from my Internet Explorer. Now I am using my workmate’s computer before I fix the settings of mine. Joerg, I did set writemode and textmode to true. Still doesn’t work. Arthur, the file is not read-only. I designed a text file will be generated by running a report at first time. When the user run it again, the new data populated will append to the file. There is no file property setup in this case. Thanks anyway.

Thanks, guys. It is working now.

Hi April, Could you please share with us what the solution was? You mentioned that it was not due to writemode/textmode or the file property. So what was it? :wink:

As i too hate thread without solutions … here my assumption: You receive this error if you make WRITEMODE(TRUE) after opening/creating of file!