IsFile after a fileDelete?
by torque4a · in Torque Game Builder · 11/20/2006 (10:28 am) · 2 replies
Ok, maybe I'm doing something wrong, I create a save file for my game so the user can return to it later.
When they load the game there's a isFile() to check for the file name... that's good.
The problem is when they beat the level their save game was for, I'm performing a fileDelete();
This also works, /but/ the next level they load checks for the file, and TGB says it's still there? Even though I can see in the file directory that it's been deleted.
Is this something well known? Has anyone figured out /why/ it would do that?
If there's a simple way to fix it, I'd be very happy, if not I guess I'll just work on coding up my own C++ code for the engine.
When they load the game there's a isFile() to check for the file name... that's good.
The problem is when they beat the level their save game was for, I'm performing a fileDelete();
This also works, /but/ the next level they load checks for the file, and TGB says it's still there? Even though I can see in the file directory that it's been deleted.
Is this something well known? Has anyone figured out /why/ it would do that?
If there's a simple way to fix it, I'd be very happy, if not I guess I'll just work on coding up my own C++ code for the engine.
About the author
#2
11/20/2006 (10:19 pm)
"setModPaths (getModPaths());" should refresh the file cache and make it realize you deleted the file. If not save the old value, call setModPaths("") and then setModPaths(%oldModPaths) should do the trick.
Torque Owner Ben R Vesco