forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Loading file from "current" directory

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
milksop



Joined: 24 Jun 2005
Posts: 10

PostPosted: Wed Jul 13, 2005 3:57 pm    Post subject: Loading file from "current" directory Reply with quote

Does anyone know how to sceIoOpen a file in the current directory? Or other suggestions on how to load a file from the PBP directory that don't involve hardcoding the path from ms0:/ all the way up?

thanks,
scott
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Wed Jul 13, 2005 4:25 pm    Post subject: Reply with quote

From Vectoroids:
Code:
  /* Used for building a path to data files. */
  char psp_filename[1024 + 1];
  /* Get the full path to EBOOT.PBP. */
  char psp_full_path[1024 + 1];
  char *psp_eboot_path;
 
  strncpy(psp_full_path, argv[0], sizeof(psp_full_path) - 1);
  psp_full_path[sizeof(psp_full_path) - 1] = '\0';
 
  psp_eboot_path = strrchr(psp_full_path, '/');
  if (psp_eboot_path != NULL)
    {
      *psp_eboot_path = '\0';
    }

Then just use sprintf(filename, "%s/%s", psp_full_path, local_path).
Back to top
View user's profile Send private message
milksop



Joined: 24 Jun 2005
Posts: 10

PostPosted: Thu Jul 14, 2005 2:51 pm    Post subject: Reply with quote

Oh, duh. Thanks. I didn't notice that argv was getting set properly in _start for sceKernelStartThread.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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