Game Development Community

TGEA 1.8.1 FileStream bug and fix.

by Stefan Lundmark · in Torque Game Engine Advanced · 07/11/2009 (7:46 am) · 1 replies

If you supply ReadWrite as mode to FileStream and the path that you're trying to open doesn't exist, it won't create the path as it does when Write and WriteAppend modes are set. You'll run into an assert and Torque will quit.

FileStream.cpp @ 141
// IF we are writing, make sure the path exists
   if ( inMode == Torque::FS::File::Write || inMode == Torque::FS::File::WriteAppend )
	   Torque::FS::CreatePath(filePath);

Change to:

// IF we are writing, make sure the path exists
   if ( inMode != Torque::FS::File::Read )
	   Torque::FS::CreatePath(filePath);



#1
07/11/2009 (8:10 am)

Thanks for the fix. Checked in.