[SOLVED]sceIoGetThreadCwd

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

Moderators: cheriff, TyRaNiD

Post Reply
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

[SOLVED]sceIoGetThreadCwd

Post by ne0h »

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.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

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.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

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.
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

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...
Post Reply