Re: Saving/Opening Files - different under PB than with build of app
Re: Saving/Opening Files - different under PB than with build of app
- Subject: Re: Saving/Opening Files - different under PB than with build of app
- From: Jim Correia <email@hidden>
- Date: Sun, 23 Dec 2001 10:32:17 -0500
At 4:15 PM +0100 12/23/01, Hampus Edvardsson wrote:
On svndag, december 23, 2001, at 03:28 , Jim Correia wrote:
The working directory may not be the same under all situations. It
is "/" when the Finder launches you (on current builds of X). You
should compute the full path to the file and use that to open it.
If you only know the location of the file relative to your
application (Perhaps if you want to open a file in the same folder
as the app), you can use the fact that the path to your app is
stored in the first command line argument.
The value of argv[0] may itself be a path relative to the current
directory, so you are no better off here.
If you are building cocoa applications you can use NSBundle to find
conveniently find files relative to your application.
Jim