| View previous topic :: View next topic |
| Author |
Message |
Stewie87
Joined: 03 Apr 2008 Posts: 39
|
Posted: Fri Aug 22, 2008 7:21 pm Post subject: Get current directory |
|
|
Is there any no-kernel function to get the current directory where the eboot.pbp (my homebrew) has started?
I want to launch another PBP from my homebrew but I have to pass it the full path of the second homebrew otherwise i get the 8002013C error...
So I wish to get current directory where both PBPs are ;)
Thanks to all ^__^ |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Fri Aug 22, 2008 7:31 pm Post subject: |
|
|
Maybe you already did it, but keep searching for "getcwd".
| Code: | #include <string.h>
#include <sys/types.h>
#include <sys/unistd.h> // for getcwd()
.
.
.
char fullName[256];
getcwd(fullName,200);
strcat(fullName,filename); |
|
|
| Back to top |
|
 |
Stewie87
Joined: 03 Apr 2008 Posts: 39
|
Posted: Fri Aug 22, 2008 7:44 pm Post subject: |
|
|
Yes, i tried it but it gave me always an undefinited reference error on "getcwd"... :(
Is there some lib that i have to include in my makefile to avoid it? |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Fri Aug 22, 2008 7:52 pm Post subject: |
|
|
nope....my little sample compiles fine with this makefile
| Quote: | TARGET = pspgpslim236
OBJS = main.o ../commons/callbacks.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
BUILD_PRX = 1
PSP_FW_VERSION=390
LIBDIR =
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = littleSample
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
LIBS += -lpsphprm_driver -lpsprtc -lpspvfpu
|
Maybe yours is a compiler/sdk issue ?? |
|
| Back to top |
|
 |
Stewie87
Joined: 03 Apr 2008 Posts: 39
|
Posted: Fri Aug 22, 2008 8:20 pm Post subject: |
|
|
Now works (my build.mak was wrong! :P) but there is another issue: getcwd return NO string... only a empty path :(
Seems it does not work! Program run without problem but when i ask the current directory (using that function) fullName is empty... :'(
Are there other solutions? |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Fri Aug 22, 2008 8:36 pm Post subject: |
|
|
| Never tried with newer FW, but i know it _was_ working... should investigate |
|
| Back to top |
|
 |
Stewie87
Joined: 03 Apr 2008 Posts: 39
|
Posted: Fri Aug 22, 2008 8:38 pm Post subject: |
|
|
| jean wrote: | | Never tried with newer FW, but i know it _was_ working... should investigate |
Maybe...
However i resolved! :D I get the current directory from argv[0] :)
Thank you for your help the same ;) |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Fri Aug 22, 2008 10:41 pm Post subject: |
|
|
| you were probably using the pspsdk libc instead of newlib. pspsdk libc doesn't set the cwd. |
|
| Back to top |
|
 |
Stewie87
Joined: 03 Apr 2008 Posts: 39
|
Posted: Sat Aug 23, 2008 1:06 am Post subject: |
|
|
| moonlight wrote: | | you were probably using the pspsdk libc instead of newlib. pspsdk libc doesn't set the cwd. |
Yes, infact i'm using the pspsdk libc :S
So i will search for these newlib :)
Thank you very much moonlight ;) |
|
| Back to top |
|
 |
|