Re: Proposal: an addition to glib for getting the absolute path of the current binary.



Enrico Weigelt said:
> * Dan Winship <danw ximian com> [2004-04-13 11:50:38 -0400]:
>
> <snip>
>> OS X-specific magic. There's an API they can use to find where the
>> bundle they were launched from is, and then they can just find all the
>> other files relative to that.
>
> And they store all datafiles beyond this prefix ?!

Not exactly.

> Well, ever I thought, they'd learned from Unix philosophy when
> they switched to bsd kernel in release X ...

The unix apps still do things in unixy ways.

The magic of which Dan spoke is only for the Foo.app-style application and
framework bundles.  There's a rigid directory structure under each bundle for
property list files, icons/translations/resources, and multiple actual
binaries to allow support for multiple processors.
http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Concepts/anatomy.html

User data and preferences are stored outside of this, in /Library or
/Users/<username>/Library.


The kernel can tell you where the bundle is, so that the application can find
all of its resources, without regard to the actual cwd or location of the
bundle in the filesystem.  The /Applications directory is then just a place
where the user is accustomed to collecting apps.  Finder (the file manager)
can tell that a directory is actually an app bundle and displays it as a
clickable application icon (found within the bundle) rather than as a
directory; however, the command shell savvy user can cd into the app bundle
and poke around in tcsh or vi or whatever.

Unixy apps, like most of the ports in Fink, still work like unixy apps, with
none of this NeXT-ish magic.


Oh, yeah, and you can also just drop an application anywhere in the
filesystem, and the shell command "open -a Foo" will start that app.  You can
move them around all you like without breaking anything.

-- 
muppet <scott at asofyet dot org>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]