Mac OS X Unleashed

Mac OS X Unleashed

By John Ray and William C. Ray

The File System—Where Did Everything Go?

Mac OS X radically changes the way that Mac users interact with their files by imposing structure on a system that previously allowed a user to delete just about every file and folder on his hard drive before complaining. For those of you who have been using the Mac OS for 15 years, this change might come as an unwelcome surprise. Interestingly, Windows 2000/XP and Linux users are likely to be more accustomed to these restrictions already.

The goal of the OS X project is to provide system stability and ease of use to as wide a range of users as possible. To do this, Apple created sets of directories that must exist on each Mac OS X installation. This produces consistency across different copies of the operating system, and makes it simple for application installers to choose the appropriate place for storing files. Users cannot modify the system-level directories or move them out of their default location. Anyone with experience using Mac OS 8 or 9 will, at one point in time, have installed a piece of software only to ask "Where in the world did that file just go?" Under Mac OS X, you'll know.

The "Computer Level" of the File System Hierarchy

Like the My Computer icon in Windows, Mac OS X provides a topmost view of the storage devices accessible to the machine. You can still see your drives mounted on the desktop, but you can also access them by looking at the Computer view of your system. Figure 3.2 shows a Finder window that is viewing the top level of the system.

03fig02.jpg

Figure 3.2 Mac OS X provides access to your drives and network within a Finder window, as well as on the desktop.

In Figure 3.2, there are three icons visible: Network, Mac OS X, and Mac OS 9.x. Within these three locations are all the files that are located on my system. Any additional FireWire or USB drives that are plugged into the system will appear in this location, as well as being mounted directly on the desktop.

The purpose of the hard drive icons should be obvious: to navigate the file system just as you would in Mac OS 8/9 or Windows. The Network icon, however, might require a bit of explanation.

Network Icon

The Network icon will be used on clustered Mac OS X installations to provide a central point of access to multiple servers, shared applications, and other network resources. In its current incarnation, it serves little purpose but to confuse the user. Mounted AppleShare volumes cannot be found within the Network directory, nor can you browse the available servers from this location. Later in the book you'll learn about a Windows-compatible file sharing tool called Sharity, which allows browsing of Windows shares within Network, but until this feature is better fleshed out by Apple, its practicality for the home user is debatable.

The Top-Level Mac OS X File System

When you open your Mac OS X boot drive, you should see a collection of permanent folders, similar to those in Figure 3.3. These directories contain all the preinstalled applications, utilities, and configuration files for your system. This will be your starting point of accessing most of the functions of your system.

03fig03.jpg

Figure 3.3 The Mac OS X top-level file system contains several permanent folders.

As a normal Mac OS X user, you cannot modify these folders by moving, renaming, or deleting them. In addition, you cannot create new folders at this level of the drive. Don't worry too much about this. If you really want to create a new folder, there are ways to do it by using the root user account. You can also create folders and files within these locations if necessary.

Applications

The Applications folder contains all the preinstalled Mac OS X applications, such as TextEdit, Mail, QuickTime Player, and many others. Any application located within this folder will be accessible to any user on the system. If you're installing an application that should be accessed by only a single person, it might make more sense to store the application within the user's home directory (home directories will be covered shortly).

Perhaps more interesting than the applications in the Applications folder is the Utilities folder also located within. The Utilities folder contains tools necessary to set up your printers, calibrate your display, and other important tasks.

Library

The Library is a new addition to the Mac OS file system, and demonstrates the modular construction of the OS X system. Although is does not have a strict definition, you can think of the Library as a storage location for system-wide application preferences, application libraries, and information that should be accessible to any user. Figure 3.4 shows the contents of the Library folder on a clean Mac OS X installation.

03fig04.jpg

Figure 3.4 The Library provides applications with a system-wide information storage area.

Some of these folders are used by applications to data such as preferences, whereas others hold printer drivers or other system additions made by the user. The default Library folders you'll find upon installation include:

Keep in mind that if you plan to run a system with multiple user accounts, these folders affect all users on the system. For example, if you purchase a screen saver module for yourself, putting it in the Screen Savers folder gives access to all users. To restrict access to a single account, you'll have to install directly into your home directory, discussed shortly.

System

Next up on the list is the Mac OS X System folder. By default, the System folder contains one other folder, called Library. This is a more specific version of the same Library folder that contains the Fonts folder and other resources. Within the System's Library folder are contained the components that make up the core of the Mac OS X experience. Even though it is possible to perform some interesting hacks to the operating system, these files and folders should not be changed unless you are aware that any modifications you make could result in your computer becoming unbootable.

Users

The Users directory is probably the most interesting and important addition to the Macintosh file system. Although it is present in Mac OS 9, the multiuser capability pales in comparison to what is available under Mac OS X.

Mac OS X is based on an underlying Unix operating system. Within Unix, each file and folder belongs to a specific user and group. The owner of a file is exactly what it sounds like—the person to whom that file belongs. If you create a file, you own it. As the owner, you have the right to decide whether you want other people to be able to view it or edit it. A file or directory's group is similar to the owner, but whereas an owner is a single person, a group can consist of many different people.

For example, assume that you (Joe) are working with team members on an annual budget report. The members of the team who should be able to read the file are Betty, Bob, and Sue. Because there can be only one owner, Betty, Bob, and Sue can be given access to the file by assigning them to a group, such as ReportReaders, and then allowing ReportReaders the ability to read the files.

In Mac OS X, there is a default group named Staff that is shared between all accounts on the system. This makes it very easy to share a file between all the accounts on the system. If you'd like tighter control for limiting access to smaller groups of people, you can do that as well—with a little bit of work. Chapter 24, "User Management," discusses the use of user and group permissions from the BSD command line and using Mac OS X's graphical tools.

There is another possibility for allowing multiple people to have access to a single file: granting access to the "world." In the event that everyone should be able to read a file, you can also grant access to anyone. This is the typical mode of operation for the traditional Mac operating system—everyone has access to everything.

These three attributes for allowing access to a file (owner, group, and world) are controlled via three sets of permissions:

Of the three permissions that can be set for the owner, group, or world, the read and write attributes should be obvious. They control the capability to read from files and write to them. The execute attribute controls whether a file should be capable of being launched by someone on the system. Some applications should be accessible by only certain users, and this attribute provides a means of selectively enabling a program to execute in the same way you can enable reading or writing.

The Home Directory

So, the system allows users to own their own files and provides a means of controlling other users' access to these files—what does that have to do with the Users directory that we're discussing? The Users directory contains the home directories of all of the users on the machine. A user's home directory can be considered that user's workplace. It is hers, and hers alone. Files and folders that are stored within a user's home directory are protected from other users.

If you've been a Mac user for a long time, you should start to think of your home directory as the place where you can make all your modifications to the folder arrangement and structure. Your home directory is the start of your personal area on Mac OS X. You can add documents, applications, fonts, screen savers—just about anything you can think of. Best of all, no one can mess with your configuration; conversely, you can't mess with anyone else's!

Within the Users directory are directories for each of the users on the system—these are the home directories themselves. Your directory will be named using the short name that you chose when you created your Mac OS X user account. Apple has created several default folders in your home directory, as shown in Figure 3.5.

03fig05.jpg

Figure 3.5 The home directory is filled with several default folders.

Even though Apple has been kind enough to include specific folders for different file types, feel free to do anything you'd like with your home directory. The only folders that should not be modified are the Desktop and Library folders. These are critical to system operation and must be maintained.

Share ThisShare This

Informit Network