Advertising (This ad goes away for registered users. You can Login or Register)

IO Library issues

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Locked
Rinnegatamante
VIP
Posts: 912
Joined: Sat Mar 26, 2011 10:02 am
Contact:

IO Library issues

Post by Rinnegatamante »

Hi, i'm having problems with sceIo functions.
I can't usre standard C IO library because they seems to crash PSPemu (fopen) so i managed to convert my code to sceIo library but i don't know where i'm wrong.

What i have to do is to write a file content in a string array as a buffer (like bin2c.exe does) but when i goes to create the buffer, i get strange character sometimes ("msQ" instead of "ms0", "<eof>" not as a escape character but as text and other strange things).

This is my current code (runScript loads the buffer as chunks of LUA code in LUA interpreter):

Code: Select all

SceUID fp = sceIoOpen(script, PSP_O_RDONLY,0777);					
				int size = sceIoLseek(fp, 0, SEEK_END);
				sceIoLseek(fp, 0, SEEK_SET);
				unsigned char *buffer = malloc(size);
				sceIoRead(fp, buffer, size);
				sceIoClose(fp);
				debugOutput("\nLaunching script");
            errMsg = runScript(buffer, true);
				free(buffer);
Advertising
If you want, visit my website: http://rinnegatamante.it :D
Locked

Return to “Programming and Security”