Tell me about the directory structure of OSX

BigToque

Lifer
Oct 10, 1999
11,700
0
76
I just bought my first Apple computer (Mac G3 powerbook) and I'm trying to learn a little bit about the system.

One of the first things I did was download Camino. I opened the .DMG file and dragged the icon into the Applications folder.

So now all I need to do is double-click on "Camino.app" and the browser opens.

Where are the rest of the files needed by Camino? Are .app files similar to .exe files? Or is the .app file a container that holds all of the required files?
 

TheStu

Moderator<br>Mobile Devices & Gadgets
Moderator
Sep 15, 2004
12,089
45
91
the .app file contains all the information that the application needs to run. It is more like a shortcut than a .exe perhaps... but ultimately, the .exe .app comparison is fairly valid, at least when you are comparing small .exes that do not require installation.
 

programmer

Senior member
Mar 12, 2003
412
0
0
Apps are typically installed as "Bundles" -- see http://en.wikipedia.org/wiki/Bundle_(NEXTSTEP)

To look inside a bundle, in Finder right-click on the app name (e.g. TextEdit) and click Show Package Contents -- that will open a window with the Contents folder inside the bundle. Go into that folder and you see more stuff. The actual binary is in the MacOS folder -- note that UNIX binaries usually don't have a file extension. The rest of the files and folders are all a standard way of packaging related resources (e.g. UI "nib" files, strings, scripts, etc).

 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: TheStu
the .app file contains all the information that the application needs to run. It is more like a shortcut than a .exe perhaps... but ultimately, the .exe .app comparison is fairly valid, at least when you are comparing small .exes that do not require installation.
Not really. A .app is a directory structure with a particular layout, as programmer explained. There are executable binaries within the folder that are the equivalent of windows .exe files. You can navigate into the folder at the commandline and start the program:

pb:/Applications/Chess.app/Contents/MacOS kamper$ ./Chess

Of course, open(1) is the more correct way to do it:

pb:/Applications kamper$ open Chess.app
 

TheStu

Moderator<br>Mobile Devices & Gadgets
Moderator
Sep 15, 2004
12,089
45
91
Ok, not really sure what you just said... but ok.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Try it out. Fire up Terminal, cd into /Applications. Then pick an app and cd into it, it's just a regular directory. Have a peak around inside and you'll see the same stuff as when you right click and Show Package Contents like programmer said.
 

TheStu

Moderator<br>Mobile Devices & Gadgets
Moderator
Sep 15, 2004
12,089
45
91
Right, i get that, i'm just not sure what most of the words mean, at least not in that order :)
 

TheStu

Moderator<br>Mobile Devices & Gadgets
Moderator
Sep 15, 2004
12,089
45
91
So, see I know what all the words mean separately, but there is a reason i am no longer studying Software Engineering. Suffice it to say, i can sort of understand what you are saying, so let's just leave it at that.