Game Development Community

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.

#1
11/20/2006 (1:06 pm)
Check TDN for file IO commands. You probably will have to "refresh" your directory within TGB before it realizes the file is gone. It may be called something like "rebuild directory list" or similar.
#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.