sceIoOpen & sprintf

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

Moderators: cheriff, TyRaNiD

Post Reply
webjeff
Posts: 66
Joined: Thu May 05, 2005 2:51 am

sceIoOpen & sprintf

Post by webjeff »

Hello fellow coders,

I am writing an app and have some questions.

1) int myfile = sceIoOpen("test.txt",O_RDONLY);
- This doesn't seem to process any fruther than this, so what am I doing wrong? Can I not access a file directly in the same folder, do I have to specify the directory, in which case what is the directory?

2) sprintf
- Is there a way to use this function on the PSP? I usually can do a sprintf("my value %i",value) what else can I do to easily concatenate a string and a float/int/etc?

Thanks alot for your help
Jeff
skippy911
Posts: 46
Joined: Fri May 06, 2005 10:20 am

Post by skippy911 »

#define target "ms0:/psp/game/mygame/test.txt"

int fd1 = sceIoOpen(target,O_RDONLY);

Hope that was the kind of example you were looking for. As far as sprintf() I have not tried it yet but it may be in the standard ps2dev toolchain so try peeking around there.
webjeff
Posts: 66
Joined: Thu May 05, 2005 2:51 am

Post by webjeff »

Yep, thats exactly what I needed, thanks!

As for the sprintf function calls, I cannot seem to get them to work, I looked at the ps2 stuff and the definitions are all in stdio.h, and the lib to that goes with stdc++ but if I include that gigantic lib I get tons of errors like linking 32 bit code with 64 bit code, etc.

So for sprintf, do I need to link with stdc++ or what lib should I link with?

Thanks for everyone's help :)
Jeff.
Post Reply