 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
webjeff
Joined: 05 May 2005 Posts: 66
|
Posted: Thu May 12, 2005 1:55 pm Post subject: sceIoOpen & sprintf |
|
|
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 |
|
| Back to top |
|
 |
skippy911
Joined: 06 May 2005 Posts: 46
|
Posted: Thu May 12, 2005 2:09 pm Post subject: |
|
|
#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. |
|
| Back to top |
|
 |
webjeff
Joined: 05 May 2005 Posts: 66
|
Posted: Fri May 13, 2005 1:56 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|