You display the File Type properties by choosing File Types from the Props menu or the Category choice on the Properties window. The default File Type Properties window is shown in Figure 16-7.
You can click SELECT on the plus sign (+) button to expand the window to display the full set of properties, including information needed to identify a class of files, as shown in Figure 16-8.
You can shrink the window back down to the smaller size by clicking SELECT on the minus sign (-) button at the bottom of the expanded window.
This section describes the fields in the File Type Properties window.
Each entry in the File Type scrolling list defines how a file, or a group of files, is recognized by DeskSet applications. You can think of each entry in the File Type scrolling list as a class of files, which may consist of one file or many files. Each class of files in this scrolling list (each File Type entry) is bound to the Icon properties of the current Binder entry.
If you have two identical File Type entries in your Binder database, only the first one that the Binder reads is used. The first Binder entry to use the File Type entry is not necessarily the first Binder entry in the Binder base window scrolling list.
Use the Pattern text field beneath the scrolling list to modify the name of a File Type entry. If the files are to be identified by a pattern, this pattern must be the name of the Binding entry. If the currently selected File Type is identified by Content, the Pattern text field is dimmed and unavailable.
When there are no items selected on the scrolling list, you can type a pattern into the Pattern text field and press Return to create a new File Type entry.
You SELECT the buttons to the right of the File Type scrolling list to create and delete File Type entries, and to move them to and from a clipboard, as follows:
New creates a new File Type entry. The name of the first new entry is unnamed_1. If you create another new entry without renaming the first, it is called unnamed_2, etc.
To change the name of a File Type entry, type a new name in the Pattern text field and press Return. If you want to identify a set of files by a pattern, you must type the actual pattern in the Pattern text field. If you want to identify a set of files by content, the name of the File Type entry can be anything.
Cut removes the currently selected File Type entry from the current Binder entry (the entry selected in the base window scrolling list), and to move it to the clipboard. If the current Binder entry is a read-only entry, the Cut button is inactive.
Copy copies the currently selected File Type entry to the clipboard.
Paste adds the File Type entry that is on the clipboard to the current Binder entry. The Paste button is inactive if there is nothing on the clipboard.
Delete removes the File Type entry from the current Binder entry. The Delete button is inactive if the current Binder entry is a read-only entry. Note that deleting a Binder entry does not delete its File Type entry.
You use the Apply and Reset buttons at the bottom of the File Type Properties window to apply your File Type and Icon Properties changes to the current Binder entry, or to reset all the changes you've made since the last Apply.
TheIdentify choice item determines how the current class of files (the selected File Type entry) is recognized by DeskSet applications, such as the File Manager. A class of files is recognized either by Name or by Content, as defined in the following sections:
If the Identify choice is by Name, files are recognized by the pattern in the Pattern text field. In this case, the Pattern is often the name of an application. For example, Figure 16-9 shows the clock File Type entry that is bound to the clock-prog Binder entry. Any file called clock will be displayed by the File Manager with the clock icon and colors displayed in the base window scrolling list. (The icon and colors are defined by the clock-prog Icon properties.)
When the Identify choice is "by Name" and the Pattern text field contains an asterisk (*), the asterisk in the Pattern means "match any file name here." For example, the File Type Entry *.ps, shown in Figure 16-10, matches all files that end with.ps. These files are PostScript files, and are displayed in the DeskSet with the postscript-file icon displayed in the Binder base window scrolling list.
An exception to the rule about matching the pattern with the file name occurs with the Binder entries default-app, default-dir, and default-doc. The File Manager application uses these entries to determine the bindings for its default application files, directories (folders), and documents. The File Type patterns for these bindings are default|app, default|dir, and default|doc. You will never, however, actually find a file called default|app, default|dir, or default|doc. See "Changing a Binding" for information about how to change these default File Manager bindings.
If the Identify choice is by Content, files are recognized by matching file contents instead of the file name. When you choose by Content, the four fields underneath the Identify setting become active. These fields define what the file contents should be to define files of the current File Type, as follows:
Tag Offset determines the starting position in the file (counting from 0) where the contents should be matched. The default value is 0, meaning "match the contents starting at the very first character of the file." A Byte Offset of 1 would start matching the contents at the second character of the file, and so on.
Tag Type determines the type of value that is to be matched in the file contents: Byte, Short, Long, or String. Most files are ASCII files consisting of the String data type (that is, words and characters that you can type). A Byte type is a one-byte numerical value, a Short is a two-byte numerical value, and a Long is a four-byte numerical value.
Tag Mask is an optional field that you can use to define a mask value for Byte, Short, or Long data types. If a mask value is defined, a logical AND operation is performed on the Tag Type in the file being bound and the Tag Mask to determine the match value (the contents to be matched). If that value matches the Tag Value, then the file is bound. This field is primarily intended for programmers developing applications to be integrated into the DeskSet environment.
See the magic manual page for advanced information about the Tag Type, Tag Mask, and Tag Value fields.
Figure 16-11 shows that PostScript files can be recognized by the string "%!" at the beginning of the file (Tag Offset = 0, Tag Type = String, Tag Value =%!). Note that PostScript files can also be recognized by files ending with.ps, as described previously in the section "Identify By Name".
Figure 16-12 shows the sun-raster File Type entry. This class of files is defined as all files starting with the Long value 0x59a66a95.