• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Saving/Opening Files - different under PB than with build of app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Saving/Opening Files - different under PB than with build of app (From: Hampus Edvardsson <email@hidden>)

  • Prev by Date: Re: Saving/Opening Files - different under PB than with build of app
  • Next by Date: How to fill a cell with color?
  • Previous by thread: Re: Saving/Opening Files - different under PB than with build of app
  • Next by thread: Succeeded?
  • Index(es):
    • Date
    • Thread