Starting Directory...

Posts: 227
Joined: 2008.08
Post: #1
For an engine I am making, I am using SDL. I know that SDL sets the starting directory to the .app's parent, and I have gone along with this for a while. An issue arises when I want to move the data into the Resource folder in the bundle, I can tell that SDLMain.c chdirs to change this, but commenting that out doesn't bring the start path to Resources.

I used GLFW when my idea of Resources being the starting path formed, I don't know if that does any automagic.

But my question is, what is the true starting directory for the different ways that an executable may be opened? Searching Apple's developer site doesn't seem to reveal much regarding this.
Quote this message in a reply
Posts: 245
Joined: 2005.11
Post: #2
OneSadCookie has (or at least had) a webpage that answers that very question - you can probably find a link if you hunt around the forums.
I wouldn't worry about it though. It is easy enough to get the path to the Resources folder from NSBundle ( [[NSBundle mainBundle] resourcePath] ) and set that to be your working directory at launch time.
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #3
Just alter SDLMain.m to do the right thing.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Copy directory madjerry 8 5,411 Jun 27, 2008 11:12 AM
Last Post: ThemsAllTook