Weird name mangling on Mac OSX
by Jason McIntosh · in Torque Game Builder · 08/31/2005 (10:33 pm) · 6 replies
I'm getting this weird thing where the names of my compiled .cs files are having #nnnn appended to them (where nnnn is 4 numbers). This makes them not usable by the engine since it reports that they have an invalid file name. The files affected have long filenames, in excess of 48 chars in some cases. Reasoning behind my weird naming aside, why the heck does Torque do this on Mac??
I guess I'll have to rename all the affected files so they're shorter. But I'm still curious about it.
I guess I'll have to rename all the affected files so they're shorter. But I'm still curious about it.
About the author
#2
Could you pretty please post that code here?
09/01/2005 (5:05 am)
Quote:You do not have access to this forum thread.I really hate that message. :)
Could you pretty please post that code here?
#3
Around line 712 in macCarbFileio.cc in the function _recurseDump() replace:
with:
09/01/2005 (9:32 am)
Here you go:Around line 712 in macCarbFileio.cc in the function _recurseDump() replace:
rInfo.pFileName = StringTable->insert(filename);
with:
char filenameBuf[MAX_MAC_PATH_LONG];
FSRef fsRef;
FSRefParam pb;
HFSUniStr255 uniNameField;
dSprintf(filenameBuf, sizeof(filenameBuf), "%s", filename);
pb.ioVRefNum = platState.volRefNum;
pb.ioDirID = dirID;
pb.ioNamePtr = cinfo.hFileInfo.ioNamePtr;
pb.newRef = &fsRef;
OSErr res2 = PBMakeFSRefSync(&pb);
if(res2 == noErr) {
res2 = FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, &uniNameField, NULL, NULL);
if(res2 == noErr) {
CFStringRef str = CFStringCreateWithCharacters( kCFAllocatorDefault, uniNameField.unicode, uniNameField.length );
CFStringGetCString(str, filenameBuf, CFStringGetLength(str)+1, kCFStringEncodingMacRoman);
CFRelease( str );
}
}
rInfo.pFileName = StringTable->insert(filenameBuf);
#4
09/01/2005 (5:55 pm)
Luke, you RULE! Thanks oodles. :)
#5
09/01/2005 (8:03 pm)
Actually Alex rules more for posting the loc first :)
#6
09/01/2005 (9:18 pm)
They both rule, because without them both I couldn't have gotten this fix. :)
Torque Owner Alex Rice
Default Studio Name
http://www.garagegames.com/mg/forums/result.thread.php?qt=13198