 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Sat Jan 13, 2007 8:11 pm Post subject: sceIoMkdir question |
|
|
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 |
|
| Back to top |
|
 |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Sat Jan 13, 2007 8:31 pm Post subject: |
|
|
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: | 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?? |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Sat Jan 13, 2007 9:40 pm Post subject: |
|
|
| 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 ? :) |
|
| Back to top |
|
 |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Sat Jan 13, 2007 11:02 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
|
|
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
|