sceIoOpen() doesnt work on flash0?

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

Moderators: cheriff, TyRaNiD

Post Reply
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

sceIoOpen() doesnt work on flash0?

Post by zydeoN »

Does anyone know why sceIoOpen() with PSP_O_WRONLY flag doesnt work in flash0 ?

I tried

Code: Select all

sceIoOpen("flash0:/test.txt",PSP_O_TRUNC | PSP_O_CREAT | PSP_O_WRONLY, 0777);
But test.txt is only created if i open it in ms0:

Code: Select all

sceIoOpen("ms0:/test.txt",PSP_O_TRUNC | PSP_O_CREAT | PSP_O_WRONLY, 0777);
However, if i open test.txt to read only, it works:

Code: Select all

sceIoOpen("flash0:/test.txt",PSP_O_TRUNC | PSP_O_CREAT | PSP_O_RDONLY, 0777);

This way it works... Perhaps i have to use a differente mode, instead of 0777. (Tried with 0744, but doesnt work too)
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

flash0 needs to be unassigned and reassigned in write mode. By default only VSH mode (0x800) apps can do this. If your app is user mode then you can simply change it to 0x800. If your app is kernel mode (which I assume it is since you can read flash0), you'll need to increase your privileges. Look at the iop.prx source code.
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

yes, i just had to reassigned it to read/write privileges...
Post Reply