sceIoMkdir question

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

Moderators: cheriff, TyRaNiD

Post Reply
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

sceIoMkdir question

Post by reefbarman »

hey everyone,

i want to create a directory within the folder of my app for example myapp/directory uding sceIoMkdir, while this is easy enough if my app is always in the same folder, but i want this to be portable so it needs to be able to be created in the sampleace no matter the psp its on or the folder my app is in, so i want to know is there a way of finding the current directery my eboot.pbp is running from with in the program or is this a lost cause and i should just create a data folder in ms0:/ ???

thanks in advance
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Post by reefbarman »

okay i didnt realised getcwd() would work on the psp but it does but then i use this code and it doesn't work

Code: Select all

int i;
	char currentDir[100];

	getcwd(currentDir, 100);

	snprintf(monthDir, 3, "%i", currentM);
	snprintf(yearDir, 11, "%i", currentY);
	snprintf(dateFile, 3, "%i", currentDate);
	snprintf(dirName, 100, "%s/data/notes/%s/%s", currentDir, yearDir, monthDir);

	oslSetTextColor(textS);
	oslPrintf_xy(200, 150, dirName);
	
	sceIoMkdir("ms0;/PSP/GAME150/pSPC/data/notes/2007/1", 0777);
anyone see why??
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Urm if you are creating directories in the current location then just call mkdir as that will worry about the CWD for you, incidently why are you no passing dirName to Mkdir ? :)
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Post by reefbarman »

sorry that was old code i posted but i did figure out what was going on, i was trying to create two directories at the same time coincidently which i guess doesn't work, its always the last thing i try that works, but thank you i think i have just realised experimentation is just as good as documentation
Post Reply