[PROBLEM] File browser and kernel mode prx

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
beasymbole
Posts: 2
Joined: Sat Nov 29, 2008 5:41 am

[PROBLEM] File browser and kernel mode prx

Post by beasymbole »

Hello everyone,

I have a problem: indeed, I want to do a file browser in my prx coded in kernel mode but when I use this simple function:

Code: Select all

void filebrowser(SceCtrlData *ut) {
     struct SceIoDirent dossier;
	 memset(&dossier, 0, sizeof(SceIoDirent));
	 
	 int pr;
	 pr = sceIoDopen("ms0:");
	 
	 
	 if(MenuExplor) {
	 if(pr >= 0) {	     
		 while(sceIoDread(pr, &dossier) > 0) {
				 if(FIO_S_ISDIR(dossier.d_stat.st_mode)) {//if it's a dir
					 sprintf(listdir, "%s\n", dossier.d_name);
				 }
				 }
	 }
	 }
	 
	 if(ut->Buttons & PSP_CTRL_SQUARE) {
	     MenuExplor = 1;
	 }
	 else if(ut->Buttons & PSP_CTRL_TRIANGLE) {
	     MenuExplor = 0;
     }	 
}
It only displays one dir and not all dirs which are present in ms0:

But when I use this function in user mode, it works and displays all dir which are present in ms0:...

Consequently, how I can resolve this problem and why is it working well in user mode and not in kernel mode?

Thanks :)
beasymbole
Posts: 2
Joined: Sat Nov 29, 2008 5:41 am

Post by beasymbole »

Any idea??
steffven
Posts: 28
Joined: Mon May 19, 2008 7:37 pm

Post by steffven »

Post Reply