Error accessing a file after WriteFile

Blitz3D Forums/Blitz3D Beginners Area/Error accessing a file after WriteFile

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I have two functions.
One Writing game save data.
One Reading game save data.

Writing Function:
I use WriteFile to write the data to a file "savegame.dat"
Then I do a CloseFile

Reading Function:
I used Openfile or ReadFile to Open the file "savegame.dat"

My problem is that the file have a size of 0 kb
Although the data was written to it.

When I terminate the app, all the data shows in the file.
The file size is then 700 kb.

For some reason I cannot seem to access the file immediately after writing any data to it

Any one heard of this before?