Muffinking
2002.06.10, 05:34 PM
ok heres the deal, in my game editor I open and save the files the user works with automatically. And since I finally figured out how to create a reference to the files properly (with help, thanks guys) I wrote a little function that accepts to variables.
void getFSSpec(char path[], char name[])
now when I pass the path and the name of the file to this funtion it crops the path by taking off the app name and sticking the name of the file onto the end of it. this is all fine and dandy but when I pass this string:
'/files/Graphics'
it always has some weird crazy character at the end of it making it too long, so when I use strlen to get the length it returns one more than it should..
but when I pass this string:
'/Files/WorldMap'
it works perfectlys.... I have to subtract one from the length to make the loop work properly.. so I have to add an addition character to the WorldMap string..
I don't really understand it..
when I run through it with the debugger every opens up properly but when I just try and open the app it says it can't find the "Graphics file" which probably means the extra character added when I go through the debugger does not exist and it is slicing off part of the path name.
I am using Project builder 2.0 beta if your wondering.
Has this happened to anyone else? I am really confused.. the code seems fine and it works under the debugger, but it would be nice not to have to hack around the problem.
any thoughts?
Hank
void getFSSpec(char path[], char name[])
now when I pass the path and the name of the file to this funtion it crops the path by taking off the app name and sticking the name of the file onto the end of it. this is all fine and dandy but when I pass this string:
'/files/Graphics'
it always has some weird crazy character at the end of it making it too long, so when I use strlen to get the length it returns one more than it should..
but when I pass this string:
'/Files/WorldMap'
it works perfectlys.... I have to subtract one from the length to make the loop work properly.. so I have to add an addition character to the WorldMap string..
I don't really understand it..
when I run through it with the debugger every opens up properly but when I just try and open the app it says it can't find the "Graphics file" which probably means the extra character added when I go through the debugger does not exist and it is slicing off part of the path name.
I am using Project builder 2.0 beta if your wondering.
Has this happened to anyone else? I am really confused.. the code seems fine and it works under the debugger, but it would be nice not to have to hack around the problem.
any thoughts?
Hank