Game Development Community

Saving files in Vista

by Aaron K Murray · in Torque Game Builder · 11/11/2007 (5:05 pm) · 4 replies

I'm having trouble saving config files in Vista. Is anyone else having this problem? It seems like the files are all read-only and cannot be changed. I realize this probably isn't an issue w/TGB - but hopefully someone out there is successfully using TGB w/Vista.

Some sample code:
%file = new FileObject();
if(%file.openForWrite(~/data/files/stats.sav)) {
%file.writeLine("CurrentLevel" TAB $LEVEL::CURRENT);
echo("File Written");
} else {
error("File could NOT be opened for writing");
}

#1
11/11/2007 (5:43 pm)
There are some problems with 1.5.1 and saving files. I do not know if it involves any of the code in your example. Have you tried that code in XP and found it to work? If so, yes, Vista. If not, it may be one of the bugs in TGB 1.5.1.
#2
11/11/2007 (5:45 pm)
I don't have a PC w/XP anymore. 2 Vistas at home and Win2k3 at the office. I believe it has to do with Vista...I was hoping somebody would say "oh yeah, I had that problem. I did xxx to fix it" :)
#3
11/11/2007 (8:14 pm)
Aaron, there is a known bug when saving files in TGB 1.5.1. I found Tetraweb's fix listed on September 29th resolved my problems. The original poster on that thread has another way of resolving the problem, but I have not tried that solution.
#4
11/11/2007 (8:46 pm)
Awesome - thank you! That solved my problem (using findFirstFile on write operations...the XML config and my own stuff)