FileIO Problem - Cannot Find File
by Andrew Richardson · in Torque Developer Network · 07/18/2009 (2:37 pm) · 1 replies
Hey I'm pretty new to Torque and I'm having a strange problem. I made a simple, very basic program that basically writes a small string to a file. It writes and reads just fine, but I can't find the actual file on my hard disk.
Here's my Write Function:
function writeFile()
{
%file = new FileObject();
if(%file.openForWrite("~/data/files/Test1.txt"))
{
%file.writeLine("Version 1.0");
echo("File Written");
}
else
{
error("File is not open for writing");
}
%file.close();
%file.delete();
}
I have taken these directly from the FileIO Tutorial. Ultimately I'm trying to save variables to a file and read them later. I want to do this with an XML file but I'm just testing it first with text files. I have also tried writing an XML file and it writes successfully, but it doesn't appear on my hard disk.
I have searched the forums, and the file isn't located in my username/application data folder. I haven't been able to find it anywhere.
So basically, how do I write a file, preferably an XML file, and have it appear in my game's directory?
EDIT: I am using Window's XP
Here's my Write Function:
function writeFile()
{
%file = new FileObject();
if(%file.openForWrite("~/data/files/Test1.txt"))
{
%file.writeLine("Version 1.0");
echo("File Written");
}
else
{
error("File is not open for writing");
}
%file.close();
%file.delete();
}
I have taken these directly from the FileIO Tutorial. Ultimately I'm trying to save variables to a file and read them later. I want to do this with an XML file but I'm just testing it first with text files. I have also tried writing an XML file and it writes successfully, but it doesn't appear on my hard disk.
I have searched the forums, and the file isn't located in my username/application data folder. I haven't been able to find it anywhere.
So basically, how do I write a file, preferably an XML file, and have it appear in my game's directory?
EDIT: I am using Window's XP
Torque Owner Andrew Richardson