| View previous topic :: View next topic |
| Author |
Message |
jiuhu
Joined: 11 Feb 2010 Posts: 5
|
Posted: Thu Feb 11, 2010 12:13 am Post subject: 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 |
|
| Back to top |
|
 |
anmabagima
Joined: 01 Oct 2009 Posts: 96
|
Posted: Thu Feb 11, 2010 12:19 am Post subject: |
|
|
Hi,
have you tried fopen from stdio.h ?
Regards,
AnMaBaGiMa |
|
| Back to top |
|
 |
jiuhu
Joined: 11 Feb 2010 Posts: 5
|
Posted: Thu Feb 11, 2010 1:36 am Post subject: |
|
|
Thanks for the suggestion, I just tried it, but same results...
Do I need to further specify the sound file that I want to use for my PRX?
Thank you.
Regards,
JiuHu |
|
| Back to top |
|
 |
roby65
Joined: 01 Jun 2008 Posts: 55 Location: Mid Italy
|
Posted: Thu Feb 11, 2010 1:41 am Post subject: |
|
|
| jiuhu wrote: | Thanks for the suggestion, I just tried it, but same results...
Do I need to further specify the sound file that I want to use for my PRX?
Thank you.
Regards,
JiuHu |
Post code, it whould work :) |
|
| Back to top |
|
 |
jiuhu
Joined: 11 Feb 2010 Posts: 5
|
Posted: Thu Feb 11, 2010 1:56 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
roby65
Joined: 01 Jun 2008 Posts: 55 Location: Mid Italy
|
Posted: Thu Feb 11, 2010 1:58 am Post subject: |
|
|
| 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 |
Uh?
Prx or eboot?
AFAIK it looks for the file in the same dir of eboot |
|
| Back to top |
|
 |
Raiden
Joined: 14 Nov 2009 Posts: 10
|
|
| Back to top |
|
 |
anmabagima
Joined: 01 Oct 2009 Posts: 96
|
Posted: Thu Feb 11, 2010 5:20 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Thu Feb 11, 2010 6:40 am Post subject: |
|
|
| What's the error return value? We can't guess it, you'll have to tell us. |
|
| Back to top |
|
 |
Davee
Joined: 22 Jun 2009 Posts: 59
|
Posted: Thu Feb 11, 2010 10:47 am Post subject: |
|
|
That's wrong in so many ways...
error is < 0 and there is no "O_RDONLY" defined in the PSP SDK. |
|
| Back to top |
|
 |
jiuhu
Joined: 11 Feb 2010 Posts: 5
|
Posted: Thu Feb 11, 2010 7:07 pm Post subject: |
|
|
| jimparis wrote: | | What's the error return value? We can't guess it, you'll have to tell us. |
is a huge negative number, -2147418110.
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 |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Thu Feb 11, 2010 11:09 pm Post subject: |
|
|
Well that number is 80010002 in hex (use Windows calculator in Programmer mode to work it out), you can search for that with psp to find out your problem.
Jim _________________ http://www.dbfinteractive.com |
|
| Back to top |
|
 |
jiuhu
Joined: 11 Feb 2010 Posts: 5
|
Posted: Fri Feb 12, 2010 12:01 am Post subject: |
|
|
Thanks guys...
I get my sound file loaded, after specifying the host0 for my path...
"host0:sound.mid" |
|
| Back to top |
|
 |
|