forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sceIoDopen and opendir behavior

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Alberto



Joined: 12 Feb 2007
Posts: 63
Location: Sofia

PostPosted: Thu Jan 13, 2011 6:19 am    Post subject: sceIoDopen and opendir behavior Reply with quote

Hi guys,

so, here I am after a looong time asking again for some light. Here's my problem:

I wrote an e-book reader, or well, a formatted-text reader, but among other things, this had me write also some kind of a file browser. So far so good.
Just for my curiosity, I wanted it to work also with the UMD, so I got it... somehow, but noted the following (please, note that i _want_ to use opendir and closedir, not the sceIoDopen and Dclose functions):

opendir doesn't work with - for example - "ms0:", as the internal call to __psp_path_absolute trats that entry as a relative path, and adds the cwd at the beginning. However, this is not an issue, as I may call it _always_ with a terminating slash; in which case the path changes from "ms0:/" to "ms0:" and everything works.

The strange thing comes when I need to open the UMD (which I previously initialized to "disc0:" - which, by the way, is the only one working, as I tried also "umd0:", "disk0:", etc. without success).

Now, while sceIoDopen("ms0:") works fine, sceIoDopen("disc0:") doesn't (and this is what sceIoDopen gets when internally called by opendir...).
That is, I _must_ pass "disc0:/" to it to correctly open the path (note the final slash).

Are you aware of this behavior? Obviously this is a bug in the sceIoDopen function (or a feature? as I discovered also other interesting things about the attributes of the files in the UMD...)

Is there anything I can do to have it correctly working, or is patching the opendir function the only solution I am left with? (the patch is indeed a one-liner, but I need to erwrite the whole function, or, ehm, recompile the toolchain...)

Sorry for the long tome...

Thanks to anyone who can help.

Cheers, A.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group