Writing to file truncates even with FILE_READ|FILE_WRITE
Mosho:
Hello,
As the title says, I have this bit of testing code, but the file has only one "1" no matter how many times I run it. What am I missing?
Thanks!
If you want to write to .txt file, use FILE_CSV not FILE_BIN.
And close the opened file after that.
Mosho:
When you open the file again the pointer is at the start of the file, you then overwrite the existing '1' with a new '1' . . . you need to seek to the end of the file before writing to it. There is example code in the FileSeek() documentation.Hello,
As the title says, I have this bit of testing code, but the file has only one "1" no matter how many times I run it. What am I missing?
FileSeek(handle, 0, SEEK_END); //---- add data to the end of file
Hello,
As the title says, I have this bit of testing code, but the file has only one "1" no matter how many times I run it. What am I missing?
Thanks!