Game Development Community

Clear File Before Writing

by Richard_H · in Torque Game Engine · 05/29/2007 (4:48 am) · 1 replies

Hi,
As some of you may know, I've stopped procrastinating and am working on my Random Mission Pack, yet again. I've run into a problem with how the mission is being written to the file. I first store all the mission text in a char array, then I open a file W/O append, but when I write it, it gets meshed in with my last mission (saved to the same file). Is there any way to clear the file before I write to it? Should I delete it before writing to it, or should what I'm currently doing work?

#1
05/29/2007 (5:14 am)
From what I know when you open a file for write it should write over what is in the file.
I have a TGB project that is using the fileobject and so far it writes over the saved data with the new data.