| View previous topic :: View next topic |
| Author |
Message |
milksop
Joined: 24 Jun 2005 Posts: 10
|
Posted: Wed Jul 13, 2005 3:57 pm Post subject: Loading file from "current" directory |
|
|
Does anyone know how to sceIoOpen a file in the current directory? Or other suggestions on how to load a file from the PBP directory that don't involve hardcoding the path from ms0:/ all the way up?
thanks,
scott |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Wed Jul 13, 2005 4:25 pm Post subject: |
|
|
From Vectoroids:
| Code: | /* Used for building a path to data files. */
char psp_filename[1024 + 1];
/* Get the full path to EBOOT.PBP. */
char psp_full_path[1024 + 1];
char *psp_eboot_path;
strncpy(psp_full_path, argv[0], sizeof(psp_full_path) - 1);
psp_full_path[sizeof(psp_full_path) - 1] = '\0';
psp_eboot_path = strrchr(psp_full_path, '/');
if (psp_eboot_path != NULL)
{
*psp_eboot_path = '\0';
}
|
Then just use sprintf(filename, "%s/%s", psp_full_path, local_path). |
|
| Back to top |
|
 |
milksop
Joined: 24 Jun 2005 Posts: 10
|
Posted: Thu Jul 14, 2005 2:51 pm Post subject: |
|
|
| Oh, duh. Thanks. I didn't notice that argv was getting set properly in _start for sceKernelStartThread. |
|
| Back to top |
|
 |
|