File I/O (resolved)
by Shane Cloutier · in Torque Game Builder · 10/08/2008 (7:01 pm) · 1 replies
First off my appologies, I've gone through several other threads and guides on file I/O , trying to avoid having to ask questions that I am sure have been answered. Using the examples i have found through out the resources we have I have the following code.
I ran this function from the console of my game and it gave me back the message file written. But of course I'm unable to find this file, I've tried several versions of the path, with and without expandFilename. Now I was just reading a forum about our file reading and writing being restricted to the following path.
C:\Documents and Settings\Username\Application Data\Publishername\gamename\game\ On Windows XP and being a hidden file, I've gone looking for hidden files in that area, but I also can't find the files there or a gamename that matches the project I'm working on. I know that this isn't much to go on but any help I can get would be greatly appreciated.
function FindMe(%this, %scenegraph)
{
%file = new FileObject();
if(%file.openForWrite(expandFilename("~/game/test.db")))
{
%file.writeLine("Hello World!");
echo("File Written");
}
else
{
error("File is not open for writing");
}
%file.close();
%file.delete();
}I ran this function from the console of my game and it gave me back the message file written. But of course I'm unable to find this file, I've tried several versions of the path, with and without expandFilename. Now I was just reading a forum about our file reading and writing being restricted to the following path.
C:\Documents and Settings\Username\Application Data\Publishername\gamename\game\ On Windows XP and being a hidden file, I've gone looking for hidden files in that area, but I also can't find the files there or a gamename that matches the project I'm working on. I know that this isn't much to go on but any help I can get would be greatly appreciated.
About the author
Torque Owner Shane Cloutier