I've got a piece of code that is trying to use a file (not a DBF) in read/write mode.
I open it with FOPEN('name',12) so as to have read/write unbuffered access.
I then use FSEEK() to go to the end of the file and use FWRITE() to add some bytes to the end of it.
I then have to go back to the start of the file, again using FSEEK(), and read the first few bytes (they're a header, like in a DBF) with FREAD(). I have to change part of the header. I go back to the start, again with FSEEK(), and write, again with FWRITE().
My problem is that I have to do this twice in a particular part of my code - but it only works once!
I've looked at the number of bytes that FWRITE is reporting as having been written. They're correct.
I've tried using FFLUSH() at the end of each cycle, but that doesn't solve my problem.