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 

[SOLVED]sceIoGetThreadCwd

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



Joined: 21 Feb 2008
Posts: 386

PostPosted: Wed Mar 12, 2008 1:00 am    Post subject: [SOLVED]sceIoGetThreadCwd Reply with quote

Excuse me, but i try to make a simple programm to print the current work directory on the screen, but in this function:

int sceIoGetThreadCwd(SceUID uid, char *dir, int len)

there's no value for *dir! or i'm not been able to display the information!
Here is the complete source code:

http://nopaste.com/p/aSwEyhPPbb

Please help me...


Last edited by ne0h on Mon Mar 17, 2008 3:17 am; edited 1 time in total
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Wed Mar 12, 2008 1:27 am    Post subject: Reply with quote

you should read something more about how to use c/c++
anyway what you are doing there is just making your own sceIoGetThreadCwd which isn't the one you wanted to call. plus your code is missing any call to the function

int main() {
pspDebugScreenInit();
SetupCallbacks();
printf("\n Hello World \n");
sceKernelSleepThread();
return 0;
}

as you can see in your main function there is no call to sceiogettread...
you will need to call the function and then printf the result. the dir argument most probably requires an already allocated space as argument which will be filled with the directory. and len most probably is how long is your buffer. as for uid you will need to pass the thread uid you want to know.
Back to top
View user's profile Send private message Visit poster's website
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Wed Mar 12, 2008 1:33 am    Post subject: Reply with quote

It's also a kernel function, and you're in user land,

There's so much wrong with your code I don't even know where to start :)

By the way, getcwd() works great.
Back to top
View user's profile Send private message
ne0h



Joined: 21 Feb 2008
Posts: 386

PostPosted: Wed Mar 12, 2008 1:47 am    Post subject: Reply with quote

Excuse me but my english are not the best ( i'm italian ),
i've insert a call in main function like SetupCallbacks();...
...
sceIoGetThreadCwd();
...
but is not true, the compiler give me many errors!
I'll try with getcwd...
I've resolved without get the current work directory!
Thanks...
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