Application Path
Application Path
Is there a way to get the full path of the code that is running...?
I have a prx module and it has a config file which i've hardcoded the location of but i've discovered that sometimes you might need to have the prx in different locations... The ideal solution is to have the prx look for the config file in the same location as itself...
Can anybody help...?
I have a prx module and it has a config file which i've hardcoded the location of but i've discovered that sometimes you might need to have the prx in different locations... The ideal solution is to have the prx look for the config file in the same location as itself...
Can anybody help...?
-
- Posts: 3
- Joined: Thu May 04, 2006 7:26 am
-
- Posts: 376
- Joined: Wed May 10, 2006 11:31 pm
Just use the relative path in your function.
This method doesn't work for the sceIo* variants, see this thread for further information http://forums.ps2dev.org/viewtopic.php?t=6567
Code: Select all
fopen("config.txt", "r");
There is no general way to get the path of the running module (like say GetModulePath in Windows) because the PSP kernel doesn't store it. Most apps rely on the path to the executable being passed as the first argument to the main function which depending on how your code is being loaded may not be correct.
Thanks, I guess i'll just have to check a selection of locations then...TyRaNiD wrote:There is no general way to get the path of the running module (like say GetModulePath in Windows) because the PSP kernel doesn't store it. Most apps rely on the path to the executable being passed as the first argument to the main function which depending on how your code is being loaded may not be correct.
@Insert_witty_name: I can't do that because it also doesn't work with prx modules unfortunatly...
Thanks for all the help,
ADe
quick thought... make a user mode thread that stores the cwd in a global variable
Code: Select all
char cwd[512];
int cwd_thread(SceSize args, void *argp)
{
getcwd(cwd,256);
return 0;
}
- be2003
blog
blog