• 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: Dir of app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dir of app


  • Subject: Re: Dir of app
  • From: William Turner <email@hidden>
  • Date: Tue, 18 Dec 2007 11:54:59 -0800

An alternative would be /Library/Scripts for scripts run by the user.

-wil

On Dec 18, 2007, at 11:11 AM, Wesley Smith wrote:

How does one find the directory of a the application one is in through
Objective-C? I'd like to use it to build up file paths.

As someone else noted, the way to do that is through NSBundle or CFBundle.

But it should also be pointed out that there are very few tasks for
which "find the path of the app" is part of the correct solution.

What are you really trying to do? What kind of file paths are you
intending to build relative to the path of your executable?


Well, in the app I'm building, there are alot of scripts that are
going to be kept in 1 of 2 places depending on if they should be
touched by the user or not.  One will be in the resources folder
inside the app folder and the other will be in a subfolder of the
app's folder in /Applications.  Here's the basic layout:

/Applications/App/
                     App/Contents/Resources/Scripts      <----
scripts the app uses internally
                     Scripts
<----- user scripts


The application is basically a shell of a Cocoa app with Lua running inside it. Everything is completely configured through scripts and I'd like to have a few directories that are standard with the app where a user can throw scripts in and have them automatically in the search paths of the app. Of course, more search paths can be added by the user, but at the minimum I want there to be 1 directory that the app always knows about and the cleanest way to do that is to define a folder relative to the app location. There are a number of apps for OSX that follow this same convention so I don't think it's unusual at all but if you have any other ideas for how to handle this, I'd love to hear them.

Also, I know Leopard has an entire event notification mechanism for
file modification.  Is there something like this on Tiger as well?

best,
wes
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Dir of app (From: Gregory Weston <email@hidden>)
 >Re: Dir of app (From: "Wesley Smith" <email@hidden>)

  • Prev by Date: Re: Binding NSTreeController to NSBrowser
  • Next by Date: Re: Binding NSTreeController to NSBrowser
  • Previous by thread: Re: Dir of app
  • Next by thread: Re: Dir of app
  • Index(es):
    • Date
    • Thread