sceIoOpen failed to read my file...
sceIoOpen failed to read my file...
hi,
I try to call the function sceIoOpen to read my file, but it fail.
I checked the return id, and it is a huge negative value.
may I know when I run and test my prx, where should I place my file together?
Currently, I am placing the prx and the file together under same dir. And sure, the path is defined correctly in my code. Example code,
buff_id = sceIoOpen("sound.mid",SCE_O_RDONLY,0);
And I am develop with a PSP Development kit.
Thank you.
Regards,
JiuHu
I try to call the function sceIoOpen to read my file, but it fail.
I checked the return id, and it is a huge negative value.
may I know when I run and test my prx, where should I place my file together?
Currently, I am placing the prx and the file together under same dir. And sure, the path is defined correctly in my code. Example code,
buff_id = sceIoOpen("sound.mid",SCE_O_RDONLY,0);
And I am develop with a PSP Development kit.
Thank you.
Regards,
JiuHu
-
- Posts: 87
- Joined: Thu Oct 01, 2009 8:43 pm
SceUID buff_id;
if ((buff_id = sceIoOpen(filename, SCE_O_RDONLY,0)) < 0){
printf("Problems here...");
return -1;
}
it seems like the application couldn't find my sound file...
Here is how my dir structure....I have a working dir named PSPSound
and I have my compiled output (prx...) in PSPSound/PSP_DebugOpt,
Am I going to place my file under the same dir with the prx?
Thank you.
Regards,
JiuHu
if ((buff_id = sceIoOpen(filename, SCE_O_RDONLY,0)) < 0){
printf("Problems here...");
return -1;
}
it seems like the application couldn't find my sound file...
Here is how my dir structure....I have a working dir named PSPSound
and I have my compiled output (prx...) in PSPSound/PSP_DebugOpt,
Am I going to place my file under the same dir with the prx?
Thank you.
Regards,
JiuHu
Uh?jiuhu wrote:SceUID buff_id;
if ((buff_id = sceIoOpen(filename, SCE_O_RDONLY,0)) < 0){
printf("Problems here...");
return -1;
}
it seems like the application couldn't find my sound file...
Here is how my dir structure....I have a working dir named PSPSound
and I have my compiled output (prx...) in PSPSound/PSP_DebugOpt,
Am I going to place my file under the same dir with the prx?
Thank you.
Regards,
JiuHu
Prx or eboot?
AFAIK it looks for the file in the same dir of eboot
Code: Select all
if(!(fd = sceIoOpen("device:/path/to/file", O_RDONLY, 0777)) {
// error
}
-
- Posts: 87
- Joined: Thu Oct 01, 2009 8:43 pm
If you are running a prx using your debugger with SAPLINK the file should be in the root directory of the local (hard disk) drive mounted with usbhost. I've currently only used fopen and it works fine for me. If you run the eboot from PSP the file need to be in the same folder as your eboot on the PSP.
That's wrong in so many ways...Raiden wrote:http://psp.jim.sh/pspsdk-doc/group__Fil ... 6859f69ec8Code: Select all
if(!(fd = sceIoOpen("device:/path/to/file", O_RDONLY, 0777)) { // error }
error is < 0 and there is no "O_RDONLY" defined in the PSP SDK.
is a huge negative number, -2147418110.jimparis wrote:What's the error return value? We can't guess it, you'll have to tell us.
Btw, do I need to specify any working directory for all my resources files?
Like specify a UMD dir for the sound files...
Do I need to specify the value for "device:" ?
Thank you.
Regards,
JiuHu