Game Development Community

T3D 1.1 Beta 3 - FS::VerifyWriteAccess() bugged - RESOLVED

by Fyodor "bank" Osokin · in Torque 3D Professional · 03/02/2011 (7:29 am) · 3 replies

Build: T3D 1.1 Beta 3 Pro

Platform: Windows

Target: Access to file system

Issues: FS::VerifyWriteAccess() doesn't use proper path for write-test.

Steps to Repeat:
Set in core/scripts/client/default.cs:
$shaderGen::cachePath = getUserDataDirectory() @"/MyProjectName/Shaders";
Expected the shaders to be generated in:
C:/Users/bank/AppData/Roaming/MyProjectName/Shaders
But it fails, as the FS::VerifyWriteAccess() returns false while checking path, as it doesn't take into account the drive letter.

Suggested Fix:
in:
bool FS::VerifyWriteAccess(const Path &path)
the "temp" declaration should be:
String temp = path.isRelative() ? path.getPath() : path.getRoot() + ":" + path.getPath();
instead of
String temp = path.getPath();

#1
03/15/2011 (2:48 pm)
Greetings!

Logged as THREED-1462. Thanks!

- Dave
#2
04/01/2011 (6:11 am)
Original post updated with proper fix.
The previous one wasn't taking into account the chance that path can be relative.
#3
04/24/2011 (3:51 pm)
Fixed in 1.1 Final and Preview.