Re: NSApplicationSupportFolder
Re: NSApplicationSupportFolder
- Subject: Re: NSApplicationSupportFolder
- From: John Stiles <email@hidden>
- Date: Mon, 27 Dec 2004 16:57:03 -0800
On Dec 27, 2004, at 4:49 PM, BK wrote:
On Dec 28, 2004, at 4:03, Sean McBride wrote:
Hard coding paths is very bad. "Application Support" may change names in
the future. Using the FSFindFolder API is best and safest.
AppleScript's Standard Additions have a command to return the path to the Application Support folder.
POSIX path of (path to application support)
--> "/Library/Application Support/"
Even if Apple was to change the path in the future, this should still return the correct path.
So, what you could do is have your application run an embedded one line AppleScript to obtain the path and then store it away for use throughout your code.
Not for purists, but safe and performance shouldn't be an issue if you call this only once.
This would require a whole lot more code than FSFindFolder, and execute probably thousands of times slower. (Yes, literally thousands, if you're asking AppleScript to compile the script before executing it; if it's the first AppleScript you compile, AppleScript's setup time could add another order of magnitude or two.) Why exactly do you recommend this approach? FSFindFolder -> FSRefMakePath is only two calls and you can cache the result just as easily. I'm not particularly a purist, but this approach just seems like such a waste for such a simple thing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden