1) Testing sceIoOpen with \ and / paths:
Worked:
Code: Select all
sceIoOpen("ms0:\\debug.txt", PSP_O_APPEND | PSP_O_CREAT | PSP_O_WRONLY, 0777);
Code: Select all
sceIoOpen("ms0:/debug.txt", PSP_O_APPEND | PSP_O_CREAT | PSP_O_WRONLY, 0777);
Worked only if file already exists:
Code: Select all
fopen("ms0:\\debug.txt", "a");
Code: Select all
fopen("ms0:/debug.txt", "a");
If you check psplibc's fopen code:
http://svn.ps2dev.org/filedetails.php?r ... rev=0&sc=0
Under the "a", there's only:
Code: Select all
case 'a':
flag = _IORW;
iomode = PSP_O_APPEND;
break;
Code: Select all
case 'a':
flag = _IORW;
iomode = PSP_O_APPEND | PSP_O_CREAT | PSP_O_WRONLY;
break;
(But all write attempts would fail due to the missing PSP_O_WRONLY)
3) Testing -lc's (newlib's) fopen with \ and / paths:
Failed:
Code: Select all
fopen("ms0:\\debug.txt", "a");
Code: Select all
fopen("ms0:/debug.txt", "a");
sceIoOpen("/Data/debug.txt", ...);
This checks for folder 'Data' in the current directory
Doing the same using fopen() would fail because you guys keep processing '/' as if it were the root dir.
A fix would be to make '/' be the current EBOOT path, like how sceIo does it
-----------------------------------------
Summary:
1) Add support for \ in newlib's fopen
2) Fix 'a' mode in -lpsplibc's fopen
3) "/debug/debug.txt" != "debug/debug.txt", when it should be ==