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?
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?
About the author
Torque Owner Anthony Abrams
I have a TGB project that is using the fileobject and so far it writes over the saved data with the new data.