Here is the code:
Code: Select all
#include <pspdebug.h>
#include <pspiofilemgr.h>
PSP_MODULE_INFO("FileIOTest", 0, 1, 1);
int main()
{
SceUID FileID;
char *TestFile;
pspDebugScreenInit();
pspDebugScreenPrintData("File Access Test",16);
FileID = sceIoOpen("ms0:/test.txt",PSP_O_RDONLY,0);
pspDebugScreenSetXY(0,1);
if (FileID == 0)
{
pspDebugScreenPrintData("Error Opening File",18);
}
else
{
pspDebugScreenPrintData("File Opened",11);
sceIoRead(FileID,TestFile,10);
pspDebugScreenSetXY(0,2);
pspDebugScreenPrintData("File Accessed",13);
pspDebugScreenSetXY(0,3);
pspDebugScreenPrintData(TestFile,10);
}
while (1) {}
return 0;
}