Writing to files outside of the directory structure
by Andy Schatz · in Torque Game Engine · 07/18/2007 (1:53 pm) · 2 replies
I'm trying to implement support for limited user accounts (particularly necessary for Vista), and I've found that Torque doesn't like to write to files outside of the basic directory structure. Yet, really I should be writing to the "Documents and Settings/Andy/Application Data" directory. Has anyone dealt with this yet?
By the way, if you need a start on this code, here's the bit that might help:
You'll also have to add the /clr flag to the file you put this in, which will require you to remove a couple other flags. You only have to do this to the file you put the function in.
By the way, if you need a start on this code, here's the bit that might help:
#using <mscorlib.dll>
using namespace System;
ConsoleFunction(getApplicationDataFolder, const char*, 1, 1, "")
{
String* s = Environment::GetFolderPath( Environment::SpecialFolder::ApplicationData );
char *returnBuffer = Con::getReturnBuffer(1024);
dSprintf( returnBuffer, 1024, "%s", s->ToCharArray() );
return returnBuffer;
}You'll also have to add the /clr flag to the file you put this in, which will require you to remove a couple other flags. You only have to do this to the file you put the function in.
#2
07/19/2007 (5:11 am)
If you have access to TGB1.5 I believe one of the changes included the ability to write outside the TGB directory.
Torque 3D Owner Vincent D