Whenever you customize the behavior of a Mac OS X application, such as changing the default font or colors or the windows that are visible, the various changes you make are saved into a preference file for that application. This is in contrast with Windows where application preferences typically are saved into the monolithic registry. And because each application stores its preferences in a separate file, the overall system is more robust than if all the preferences were in one big file. If a preference gets corrupted, it is less likely to affect the system and typically affects only the application that uses that preference. The designated location for preference data is the
Library/Preferences folder in each of the filesystem domains. (Review Chapter 3 for more information about filesystem domains.)
Many Mac OS X applications, including all the applications Apple provides, go beyond just using the
Library/Preferences directory and store their preferences in the defaults system
. This system, which is often referred to as the defaults database, is made of each application’s preferences stored in an XML-based property list (
plist) file in the Preferences folder. By using the defaults system, applications can use code in the operating system to manage preferences instead of having to provide their own preference-handling code. Additionally, you can use the
defaults command in the Terminal to read and write data into the defaults database.