- The Layers of Mac OS X: Aqua
- The Layers of Mac OS X: Application Environments
- The Layers of Mac OS X: Graphics Services
- The Layers of Mac OS X: Darwin
- Domains: An Overview
- The Libraries of Mac OS X: /System/Library
- The Libraries of Mac OS X: /Library
- The Libraries of Mac OS X: /Users/"Home"/Library
- Fonts in Mac OS X: Font Formats
- Fonts in Mac OS X: Working with Fonts
Domains: An Overview
Having dissected the layers of Mac OS X, it's time to take Mac OS X apart again, but from a different perspective. In this section, you will examine why Mac OS X has multiple Library folders/directories. You will learn the different functions of each folder and directory and get an overview of the files and folders contained within them.
First, a bit of background. Mac OS X was born when Apple acquired the NeXT OS, often referred to as OpenStep, back in 1997. This was when Steve Jobs, the founder of Apple and NeXT, returned to Apple. The result is that much of the higher-level OS software is based on NeXT code. In fact, it is not unusual to peek inside some System software file and see a reference to NeXT or OpenStep.
At a practical level, this means that the System Folder of Mac OS 9 is gone from Mac OS X. Gone also are the control panels and extensions that populated the System Folder. Instead, you have the Library folderor, more precisely, a multitude of Library folders. The reason relates to the fact that Mac OS X is inherently a multiple-user system. Different Library folders correspond to different domains or levels of the OS. At the top level (System), for example, changes affect all users of the Mac in question. At the bottom level (User), changes affect only the individual user who is logged in.
The Classic Mac OS was designed with the idea that only one person (or perhaps one family) would be using a Mac. The ability to set up security so that Person A could not access the files created by Person B was irrelevant to the original Mac OS. Such security was added to the Mac OS eventually, but it was never completely successful. Mac OS X, in contrast, enforces a multiple-user setup. This setup can be annoying if you are the only person who intends to use your Mac, as you will have to deal with an overhead and complexity that you will never need. The up side is that if you ever do need a multiple-user setup, Mac OS X is far better equipped to handle it than Mac OS 9 ever was.
SEE
"Take Note: Mac OS X and Multiple Users," in this chapter, for more detailed information.
"Mac OS X: The down and up sides," in Chapter 1, for more background on why Unix is included as part of Mac OS X.
Chapter 8 for more information on file sharing.
TAKE NOTE
Mac OS X and Multiple Users
To fully understand the why and where of all the Library folders in Mac OS X, you need to understand the multiple-user nature of Mac OS X. I cover this important topic from different perspectives at several points in this book.
Mac OS 9. Mac OS 9 is an inherently single-user system. All users share the same resources in the single System Folder on the drive. In fact, the basic OS makes no attempt to distinguish whether a different user is accessing the Mac. When you sit down to play a game on a Mac running Mac OS 9, you could be John Doe or Elton John; the Mac would not know or care about the difference. This is the way most Mac users use their Macs.
There are two main exceptions to this rule:
The Users & Groups tab of the File Sharing control panel allows you to set up restrictions on who can access your Maceither over a local network or a remote connectionand what sort of access such users can have. In particular, you can make some folders accessible and mark others as off-limits.
The Multiple Users control panel allows you to set up your Mac so that different users have their own separate log-in passwords andto some extentmaintain their own separate preferences settings (stored outside the System Folder).This arrangement allows separate users to access the same Mac, each with their own customized settings and their files secure from access by other users. Unfortunately, the Multiple Users feature has never been a complete success. Too often, you wind up tripping over problems that stem from the fact that the OS was never designed to cope with such matters. A given application may not be aware of Multiple Users'"rules" and may refuse to store its preferences settings anywhere other than the System Folder. This situation would block each user from maintaining his or her own customized preferences.
Mac OS X. Mac OS X is an inherently multiple-user system. You cannot turn this feature off.
Bear in mind that Unix was created as an OS for large networked systems. As such, it needed to allow hundreds of people to log in to the same system. At the same time, it needed to maintain a level of security such that no user could access the private data of another user. Just as important, no user (other than the few people who needed such access) could access the main system software needed to keep everything running. This restriction prevented any user from deliberately or inadvertently bringing down the entire system.
Mac OS X adopts the same Unix-based security features. In general, there are three levels of users:
Ordinary. These users have access only to files that are in their own Home directories, unless an administrator specifically grants them access to other files.
Administrative. These users have access to those sections of the OS designed to be shared among all users, such as the Applications folder. An ordinary user cannot add anything to or remove anything from the Applications folder. By default, even an administrative user cannot access certain areas used by the System that are considered essential to running the OS. Administrators can access these files via root access, however, if they have the root password.
Root. These users are the only ones who can modify and access the essential System software needed to keep the OS running, as well as anything else on the volume.
Thus, even as an administrative user, you don't own the OS in the way you do as a Mac OS 9 user. In particular, the OS may tell you that you don't have permission to move or delete certain files or to add files to certain folders. The truth is that you don't own Mac OS X; Mac OS X owns Mac OS X. You are just a privileged visitor.
The software needed to sort everything out is set up by default when you install Mac OS X. You don't do anything to start it working, and you can't turn it off.
When you install Mac OS X, you set up an initial account for yourself. You are given administrator status automatically. The OS also, by default, turns off the requirement to log in at startup. (You can change this setting via the Login System Preferences window). Thus, when the OS starts up, you are not required to enter a password, so it may appear that no security is being enforced. But don't be fooled. The security features are indeed in effect.
SEE
"Privileges," in Chapter 3 (especially "Take Note: Root Access"), for more information on privileges settings and logging in as a root user.
Chapter 6 for solving troubleshooting problems that require modifying privileges/permissions settings.
Chapter 8 for more coverage of permissions and file sharing.
System domain
The first Library folder on your tour is at the root level of the Mac OS X volume. To get there, open any Finder window. In the toolbar of the window that appears, click the Computer button. If no toolbar is present, click the oval icon in the top-right corner of the window to reveal it. Alternatively, you can Command-click the name of the window in the title bar and, from the pop-up menu that appears, choose the bottom item (the name of your computer). You almost always have multiple ways to do the same thing in Mac OS X!
SEE
Chapter 3, especially "Toolbar and Finder views," for more background on navigating Finder windows and using the toolbar.
Within the Computer window, double-click the volume icon that is the current Mac OS X startup volume. You are now at the root level of Mac OS X. Locate the folder called System; it should have an X on it. Double-click the icon. Inside will be a folder called Library. You have now arrived at the first stop on your tour.
TAKE NOTE
The Computer and "Root Level"Windows
The Computer window. If you click the Computer icon in the toolbar of a Finder window, the Computer level window opens.This window lists all mounted volumes, including hard drives, CD-ROMs, and iDisks. It also includes the Network item/icon, as described elsewhere in this chapter.
A hard drive can be divided into multiple partitions. In this case, each partition functions almost as though it were a separate drive and will have a separate listing in this window. The term volume refers to a drive, a partition of a drive, or anything else that can be mounted in Mac OS X.
The name of the Computer window will not be Computer but the name you assigned to your computer when you first set up Mac OS X. This name is accessible (and editable) from the Network Identity tab of the Sharing System Preferences window.
The icons at the Computer level are also represented by identically named icons on the right border of the Desktop (assuming you enabled the feature to show these icons on the Desktop via the Finder's Preferences command).
The root level of the startup volume. If you double-click any of the icons in the Computer window, you are taken to the root level of that volume. If you go to the root level of the volume that is the current Mac OS X startup volume, the window that appears will contain at least four folders:
System. This is the folder that holds "core" Mac OS X software, as described in the main text.
Library. This is the folder that contains "local domain" Mac OS X software, as described in the main text.
Applications. This folder houses all the applications initially installed by Mac OS X, as well as any other applications that may have been installed there by you or by third-party installers. The Utilities folder is also within this folder.
Users. This folder contains the "home" directories for each user with an account on the volume. The Shared directory is also here.
If Mac OS 9 is installed on this volume, there will also be a folder called System Folder; it may have a 9 icon on it. This folder is not the Mac OS X System folder/directory referred to in the main text! In addition, there will be a folder called Applications (Mac OS 9). This contains application software installed by Mac OS 9, such as SimpleText and QuickTime Player.
If you installed the software from the Developer Tools CD, a folder named Developer is located at the root level.
Finally, the Unix directories (normally invisible in the Finder) are located here.
The root level of other volumes. If you click any of the other volume icons in the Computer window, you will similarly go to the root level of those volumes. What is located in each one depends, of course, on the nature of the volume. It could be another Mac OS X volume, a Mac OS 9 volume, or simply a volume that stores files (with no OS software at all).
In the structure of Mac OS X, the root level volume of the startup volume has a special status. For example, the "root level" in Terminal (as covered in Chapter 10) refers only to the Mac OS X startup volume's root level. Other volumes are structured differently. For example, select the Finder's Go to Folder command and type: </Volumes>. This will take you to the Unix Volumes directory, located at the startup volume's root level. Here you will see a listing for every mounted volume except the startup volume.
SEE
"Take Note: What and Where are the Unix Files?" earlier in this chapter.
Chapter 2 for more information on partitioning a drive.
Chapters 3 and 8 for more on the Sharing System Preferences and Users folders.
Figure 4.6 The Computer and root Mac OS X volume (R2D2 in this case) windows (normal views; with invisible items invisible). Note: Mac OS 9 is not installed on R2D2.
If the Mac OS X System folder strikes you as being the Mac OS X equivalent of the Mac OS 9 System Folder, you are more or less correct. The Library folder here contains the files that are essential to the operation of the OS. Every file in this folder is installed by the Mac OS X Installer itself (or another Apple-supplied updater). The contents of this folder rarely get modified, other than by an update to the OS. In fact, Apple warns against modifying the contents, as doing so could result in failure to start up the computer. If you even try to make a change in this folder, you will be blocked from doing so, getting a message such as "The item could not be moved because Library cannot be modified." Only users with root access can make changes.
SEE
"Take Note: Mac OS X and Multiple Users," earlier in this chapter, for background.
Occasionally, you will want to modify files in this folder; I mention examples elsewhere in this book. But by and large, I concur with Apple's assessment: Troubleshooting will rarely require modifying the contents of this folder.
SEE
"Miscellaneous other installation problems," in Chapter 2, for a mention of folders, other than Library, that you may find at the root level of the Mac OS X System folder.
Local domain
Return again to the root level of the drive. You will see a folder called Library. Inside it is an assortment of folderssome with the same names as the ones in the /System/Library folder.
The contents of this Library folder are populated when you install Mac OS X. But unlike the System/Library folder, it can be modified directly by any administrative useras well as by installer applications for third-party software.
The function of this Library folder is to contain all the resources to be shared by all the local users of the computer. Note: A local user is anyone who has physical access to the computer and can log into it directly.
User domain
Next, click the button in the toolbar that says Home. This button will take you to the top level of the directory for the person who is logged in (presumably, you!).
Figure 4.7 Inside my Users folder.
Another way you could get Home is to open the Users folder at the root level of Mac OS X. Inside, you will see at least two folders:
Shared. The Shared folder houses files that any user can access and modify.
SEE
Chapters 6 and 8 for more information on the Shared folder and file sharing.
Home. This folder will have the name you assigned when you first set up the OS (such as landau). If you have created more than one user, you will find additional folders with those user names. Your folder (if you are the logged-in user) will have a house icon; the others will have a generic folder icon. If you open your own folder, you will be at the same place as if you clicked the Home button.
Inside your Home folder will be a third Library folder. Every user will have a comparable Library folder. These user-level Library folders contain the resources specific to each user. Any personal preferences you set for an application will be stored here. That way, when you log in, those preferences will be in effect. When another user logs in, the preferences set by that user will be in effect instead.
Network domain
Your drive has a fourth-level Library folder. To find it, return to the Computer window, and double-click the globe icon called Network. In the window that appears will be yet another Library folder.
If you open this Library folder, it is likely to be empty. The folder comes into play only if you are on a network that is connected to a central server (such as a computer running Mac OS X Server software). In such a case, this Library folder would contain the shared resources (usually stored on the server itself) that can be used by all those on the server's network.
At this level, you will also find an alias icon called Servers. If you double-click this icon, you will see a list of networks to which you can connect. Typically, if you are not on any network, the only thing that will appear is an icon called localhost. If you double-click this icon, you will be back at the root level of your Mac OS X volume.
I will not be discussing troubleshooting server networks in this book, as that is best left to server administrators, not end users. Thus, I will rarely mention the Network domain again.
TAKE NOTE
Multiple Folders of the Same Name in Multiple Library Folders
As noted in the main text, several folders (such as Fonts and Sounds) appear in more than one Library folder. The reason for these multiple folders, including the multiple Library folders themselves, is for the different levels of access that each folder provides. To make this arrangement as clear as possible, here is an overview, using the different Fonts folders as a specific example.
User [~/Library/Fonts/]. The fonts here are accessible only to that user. The user can add fonts to or remove fonts from this folder, as desired. This method is how a nonadministra-tive user can access new fonts.
Local [/Library/Fonts/]. Any local user of the computer can use fonts installed in this folder. A set of these fonts is installed by the OS. The OS does not require these additional fonts for system operation, however. An admin user can modify the contents of this folder, which is the recommended location for fonts that are shared among applications and users.
System [/System/Library/Fonts/]. This folder contains the essential fonts required for the OS to run (such as the ones needed for creating menus and dialog-box text). These fonts should not be altered or removed.
Network [/Network/Library/Fonts/]. The Network folder is for fonts shared among all users of a local area network. This feature normally is used on network file servers under the control of a network administrator.
Classic [/System Folder/Fonts/]. This folder contains fonts used by the Classic environment. If more than one Mac OS 9.x System Folder is present, only fonts in the System Folder selected in the Classic pane of the System Preferences window are used. Mac OS X applications can use these fonts even when the Classic environment is not active. These fonts can be accessed even if they are in locations other than the Fonts folder.
Classic applications can access only fonts in the Classic System Folder, however, not those stored in Mac OS X Fonts folders. An exception: The third-party software Suitcase includes an extension called Suitcase Bridge. When installed in the Classic System Folder, this extension allows fonts activated in Mac OS X to be available to Classic applications.
Fonts may also be stored in association with specific applications. Inside the Office folder of the Microsoft Office X folder, for example, is a folder called Fonts. This folder contains an assortment of fonts that get installed when you install Microsoft Office. The fonts are copied to the Fonts folder of your Home directory the first time you launch Office.
SEE
"Take Note: Problems with Duplicate Fonts in Fonts folders," later in this chapter, for related information.