| View previous topic :: View next topic |
| Author |
Message |
ne0h
Joined: 21 Feb 2008 Posts: 386
|
Posted: Wed Mar 12, 2008 1:00 am Post subject: [SOLVED]sceIoGetThreadCwd |
|
|
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 |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Wed Mar 12, 2008 1:27 am Post subject: |
|
|
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 |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Wed Mar 12, 2008 1:33 am Post subject: |
|
|
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 |
|
 |
ne0h
Joined: 21 Feb 2008 Posts: 386
|
Posted: Wed Mar 12, 2008 1:47 am Post subject: |
|
|
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 |
|
 |
|