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.