Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 7 - Finder Interface / Using the Finder Interface


Using the System Folder and Its Related Directories

The System Folder is a directory that stores essential system software such as the System file, the Finder, and printer drivers. System 7 introduced a new organization for the System Folder, which contains a set of new subdirectories to hold related files. The Finder uses these subdirectories to facilitate file management for the user. For example, by sorting and storing such files as desk accessories, control panels, fonts, preferences files, system extensions, and temporary files into separate folders for the user, the Finder keeps the top level of the System Folder from being cluttered with dozens, or even hundreds, of files.

The user can easily install and remove fonts, sounds, keyboard layouts, control panels, and system extensions by dragging their icons to the System Folder icon. The Finder then moves them into the proper subdirectories. When a control panel icon is dragged to the System Folder icon, for example, the Finder presents a dialog box that asks the user, "Place this control panel into the 'Control Panels' folder?" The user accepts by clicking the OK button or declines by clicking the Cancel button.

Note
If users drag icons to the open System Folder window instead of to
the System Folder icon, the Finder copies or moves the files into the System Folder directory instead of copying or moving them to the proper subdirectories.
Figure 7-15 shows a user's view of the new directory organization typically found within the System Folder.

Figure 7-15 The System Folder and related folders

Additional related directories are located at the root directory. Notice the Trash window. It shows the contents of the Trash directory, which is represented to the user by the Trash icon. The Trash directory exists at the root level of the volume. A Macintosh sharing files among users in a network environment maintains separate Trash subdirectories within a shared Trash directory. That is, the server creates a separate, uniquely named Trash subdirectory for every user who opens a volume on a Macintosh server and drags an object to the Trash icon. All Trash subdirectories within a shared Trash directory are invisible to users. On the desktop, the user sees only the Trash icon of the local Macintosh computer. When the user double-clicks the Trash icon, a window reveals the names of only those files that the user has thrown away; no distinction is made to the user as to which computers any of these files originated on.

At the root level of the volume, the Finder also maintains a Temporary Items folder
and a Desktop Folder, both of which are invisible to the user and so don't appear
in Figure 7-15.

Figure 7-15 illustrates the folder organization typically found on single-user systems. Of all the related directories shown, your application is likely to use only the Preferences folder and the Temporary Items folder. However, you cannot be certain of the location of these or any of the other system-related directories. In the future, these system-related directories may not be located in the System Folder or in the root directory.

You can use the FindFolder function (described on page 7-51) to get the path information to these directories. Of these directories, the only ones you are ever likely
to need are Preferences, Temporary Items, and Trash. For example, you might wish to check for the existence of a user's configuration file in Preferences, create a temporary file in Temporary Items, or--if your application runs out of storage when trying to save
a file--check how much storage is taken by items in the Trash directory and report this to the user.

Your application may freely use these two directories for storing and locating
important files:

It's important to bear in mind a few rules about storing your application's files. First, don't store any files at the top level of the System Folder. Use the Preferences directory
or one of the other directories described in the following list.

Second, use the FindFolder function to locate or put files in the right place. Don't assume files are on the same volume as your application; they could be on a different local volume, or on a remote volume on the network.

Third, don't store any files that multiple users may need to access, such as dictionaries and format converters, in the Preferences directory or in any of the directories located in the System Folder. Remember that the files in the System Folder are generally accessible only to the person who starts up from the System file in that System Folder.

There are additional directories that either the user or the Finder uses for storing and locating important files; these directories are described here. Generally, your application should not store files in these directories.

Although the names of the visible system-related folders vary on different international systems, the invisible directories Temporary Items and Desktop Folder keep these names on all systems. System software assigns unique names for invisible Trash subdirectories.

Generally, you should store application-specific files in the folder with your application, not in any of these system-related directories. Your application may want to provide users with a mechanism to specify a directory in which to look for auxiliary files. For example, you could design a customized version of the open file dialog box that allows users to specify a path to locations where files are stored. This technique may be useful for finding files that are shared by several applications. It's also possible to track the location of files by using the Alias Manager. For details, see the chapter "Alias Manager" in Inside Macintosh: Files.

When you design your application, it's important to consider the user's view of the tools that you provide. In most cases you'll want to build your application so that the user deals with one icon that represents the entire set of abilities your application provides. This scheme simplifies the user's world by restricting the complexity of installing and maintaining your product. If you provide optional tools--such as a dictionary and thesaurus--that have their own icons, it's a good idea to allow these tools to work from any location in the file system rather than relying on their storage somewhere in the System Folder.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996