Originally Posted by
Elysia
The C function fopen will deny read/write access by default.
Yes I know that. But since I don't want the file to be accessible at all while the program is running, I should keep it open (whether reading or writing mode) and switch between the modes by using freopen(). something like this:
Code:
fopen(file, "r"); // first time
... // read from file and keep file open
freopen(NULL, "w", file); // switch to write mode
... // write to file
fclose();
Would this work (I already started implementing it, but I'm still not sure it'll work).