forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sceIoOpen & sprintf

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
webjeff



Joined: 05 May 2005
Posts: 66

PostPosted: Thu May 12, 2005 1:55 pm    Post subject: sceIoOpen & sprintf Reply with quote

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
View user's profile Send private message
skippy911



Joined: 06 May 2005
Posts: 46

PostPosted: Thu May 12, 2005 2:09 pm    Post subject: Reply with quote

#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
View user's profile Send private message
webjeff



Joined: 05 May 2005
Posts: 66

PostPosted: Fri May 13, 2005 1:56 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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