1.4 stat pathname checking
by Steve Lamperti · in Torque Game Engine · 11/18/2005 (9:47 am) · 3 replies
I've been having trouble with TGE 1.4 on the mac, and I've finally tracked the problem down to something kind of strange, which I was hoping someone could help me with.
The pathnames on the mac side are set up to use the forward slash as a separator character. When I checked the behavior of the stat function on my machine, it seems to be assuming the ':' character will be the separator. This combination means that when I run my project, it can't find anything. (The calls that are failing are isSubDirectory, and isDirectory.)
If anyone has any suggestions I would appreciate hearing them. Perhaps there's a system setting to tell the stat call to look at '/' characters instead of ':'?
Thanks
The pathnames on the mac side are set up to use the forward slash as a separator character. When I checked the behavior of the stat function on my machine, it seems to be assuming the ':' character will be the separator. This combination means that when I run my project, it can't find anything. (The calls that are failing are isSubDirectory, and isDirectory.)
If anyone has any suggestions I would appreciate hearing them. Perhaps there's a system setting to tell the stat call to look at '/' characters instead of ':'?
Thanks
#2
We are using Codewarrior. (I know it's not officially supported anymore, but with a bit of work it still works.)
We are also using the CFM linker, not Mach-o.
It looks like the version of stat that links in with the CFM linker in codewarrior works differently then the version of stat that links in with the mach-o linker. I used a kludge from meterowerks to call the newer version of stat, and this seems to be working better.
11/21/2005 (9:08 am)
I believe I have tracked this down further, and I will post some additional information here, in case anyone else is having the same problem.We are using Codewarrior. (I know it's not officially supported anymore, but with a bit of work it still works.)
We are also using the CFM linker, not Mach-o.
It looks like the version of stat that links in with the CFM linker in codewarrior works differently then the version of stat that links in with the mach-o linker. I used a kludge from meterowerks to call the newer version of stat, and this seems to be working better.
#3
Yeah, Codewarrior has some of it's own standard library function implementations. This is because pre-OSX, some of the standard c library stuff wasn't quite all there. The path delimiter for pre-OSX was ':', not the unix standard '/'. So, it sounds like a codewarrior CFM target will be using the old implementation by default.
I'm glad you found a workaround!
11/21/2005 (2:07 pm)
Ah, ok. Yeah, Codewarrior has some of it's own standard library function implementations. This is because pre-OSX, some of the standard c library stuff wasn't quite all there. The path delimiter for pre-OSX was ':', not the unix standard '/'. So, it sounds like a codewarrior CFM target will be using the old implementation by default.
I'm glad you found a workaround!
Torque Owner Paul Scott
Default Studio Name
What version of MacOS are you running on? I'll do some testing & see what I see...