Re: Fw: GetSharedLibrary
Re: Fw: GetSharedLibrary
- Subject: Re: Fw: GetSharedLibrary
- From: Marc Poirier <email@hidden>
- Date: Sat, 5 Jul 2003 21:38:01 -0500 (CDT)
On Fri, 4 Jul 2003, Michael Olsen wrote:
>
> Yes, this is true. I have seen problems on French systems with my software
>
> where it assumed that the library was at /Library - on a French-language
>
> install it can apparently be called "Bibliotheque" or some such. Presumably
>
> the same is true of other non-English installs, but so far the only problem
>
> I've seen was on a French system.
>
>
Interesting... Other parts of my code is actually hardcoding that path
>
(to get to a resource file), because I couldn't find a way to get that
>
library path... (So I got the system path, used the drive name from
>
that, and added ":Library:CFMSupport:" to that).
>
>
Any ideas on how to do it properly?
Yes, use FSFindFolder for any system paths. Although that's actually not
the way to properly do what specifically you are doing...
>
> Put all your resources into your app's bundle. NSBundle has fine
>
> methods to get the absolute paths independant of how you start your
>
> app.
>
>
That won't do, I'll still need the path for misc. things like
>
preferences etc. etc.
No no no no no no... :) First of all, you should learn about bundles.
If you think that they will make your code any less cross platform, you
are mistaken. Bundles are kind of like "virtual files" that are actually
directories. To the user, they appear as a single file (your app or
plugin or whatever), but the structure is actually a directory containing
the executable code as one file and other resources as individual files.
So you can have your library contained within the app/plugin bundle and it
works for the user still like just one file that you drag and drop, but
you can load it as an individual file (check out the CFBundle API for ways
to get CFURLs to files and directories inside of your bundle; and you
can convert back and forther between FSRefs and CFURLs when necessary).
This is much better than cluttering the user's system with scattered
library files.
Also, again, you do not want to use paths for preferences. In fact, you
don't even want to use FSFindFolder (although you could). Best is to use
the CFPreferences API.
Marc
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.