Appendix E. Predefined File Types
Prev |  | Next

## Appendix E. Predefined File Types

This appendix lists the predefined file types and their associated tag numbers that are available for your use. Topics include:

- “Naming Conventions for Predefined File Types”

- “The Predefined File Types and What They Do”

You can use these predefined file types for utilities that do not need a unique, personalized look. You may also want to use these file types as SUPERTYPEs for your own custom file types.

## Naming Conventions for Predefined File Types

The file types listed in this appendix are named according to the conventions listed in Table E-1.

Table E-1. Predefined File Type Naming Conventions

If the file type name includes: | Then
--- | ---
1-Narg | it requires at least one argument
1arg | it requires exactly one argument
2arg | it requires exactly two arguments
3arg | it requires exactly three arguments

In all cases, if the expected number of arguments is not received, `launch` is run so that users can type in the desired options. For more information on the `launch` command, see the `launch(1)` reference page.

## The Predefined File Types and What They Do

In this section, file types that are essentially the same, except for the number of arguments they require, are grouped together by the “base” file type name, meaning the file type name without the argument codes described in “Naming Conventions for Predefined File Types”.

For example, to find the file type named “ttyLaunchOut1argExecutable,” look under “ttyLaunchOutExecutable.” These two file types are identical, except that “ttyLaunchOut1argExecutable” requires exactly one argument.

### SpecialFile

“SpecialFile” is a predefined SUPERTYPE, not an actual file type. When you include the SPECIALFILE rule in your file type, you should also declare the “SpecialFile” SUPERTYPE. This allows applications to use `isSuper`(1) to test whether your file type is a SPECIALFILE.

### Directory

    TYPE Directory
    MATCH (mode & 0170000) == 040000;

The “Directory” type. Any custom file types you define for directories should include “Directory” as a SUPERTYPE. “Directory” is defined in `/usr/lib/filetype/default/sgidefault.ftr`.

### Ascii

    TYPE Ascii

“Ascii” is a pseudotype defined to support `routeprint` conversions. Actual ASCII text files have the type “AsciiTestFile”:

    TYPE AsciiTextFile
    MATCH ascii;

“Ascii” is defined in `/usr/lib/filetype/system/sgisystem.converts.ftr` and “AsciiTextFile” is defined in `/usr/lib/filetype/default/sgidefault.ftr`. The Ascii icon is `/usr/lib/filetype/default/iconlib/AsciiText.closed.fti` superimposed over `/usr/lib/filetype/iconlib/generic.doc.fti`.

### Source Files

    TYPE SourceFile

“SourceFile” is a pseudotype defined to support `routeprint` conversions. Actual source files have more specific types such as:

    TYPE Makefile
    MATCH (glob("[mM]akefile") || glob("*.mk")) && ascii;
    TYPE HeaderFile
    MATCH glob("*.h") && ascii;
    TYPE CPlusPlusProgram
    MATCH glob("*.c++") && ascii;

TYPE CProgram
MATCH glob("*.c") && ascii;

TYPE Program
MATCH (glob("*.[pfrasly]") || glob("*.pl[i1]")) && ascii;

“SourceFile” is defined in `/usr/lib/filetype/system/sgisystem.converts.ftr` and the specific types shown above are defined in `/usr/lib/filetype/system/sgisystem.ftr`.

### Binary

“Binary” is a predefined SUPERTYPE, not an actual file type. You can create custom file types using “Binary” as a SUPERTYPE.

### ImageFile

    TYPE ImageFile

“ImageFile” is a top-level image pseudotype. You can create custom file types using ImageFile as a SUPERTYPE, or you can use a more specific file type such as:

    TYPE SGIImage
    MATCH short(0) == 000732 ||
    # normal SGI image
    short(0) == 0155001;
    #byte-swapped SGI image
    TYPE TIFFImage
    MATCH long(0) == 0x49492a00 || long(0) == 0x4d4d002a;
    # TIFF image
    TYPE FITImage
    MATCH string(0,2) == "IT";
    # FIT image
    TYPE PCDimage
    MATCH string(2048,7) == "PCD_IPI";
    # Kodak Photo CD image pack
    TYPE PCDOimage
    MATCH string(0,7) == "PCD_OPA";
    # Kodak Photo CD overview pack
    TYPE GIF87Image
    MATCH string(0,6) == "GIF87a";
    # GIF image (GIF87a format)
    TYPE GIF89Image
    MATCH string(0,6) == "GIF89a";
    # GIF image (GIF89a format)

These and other file types are defined in `/usr/lib/filetype/system/sgiimage.ftr`.

### Executable

“Executable” is a predefined SUPERTYPE, not an actual file type. You can create custom file types using “Executable” as a SUPERTYPE.

### Scripts

    TYPE Script
    MATCH (mode & 0111) && ascii;

This is the file type for shell scripts, defined in `/usr/lib/filetype/default/sgidefault.ftr`.

### GenericWindowedExecutable

    TYPE GenericWindowedExecutable
    MATCH   tag == 0x00000000;
    TYPE Generic1-NargExecutable
    MATCH   tag == 0x00000020;
    TYPE Generic1argExecutable
    MATCH   tag == 0x00000001;
    TYPE Generic2argExecutable
    MATCH   tag == 0x00000002;
    TYPE Generic3argExecutable
    MATCH   tag == 0x00000003;

Simply runs the command. No output or terminal emulation windows are used. These file types are defined in `/usr/lib/filetype/system/sgicmds.ftr`.

### LaunchExecutable

    TYPE LaunchExecutable
    MATCH   tag == 0x00000100;
    TYPE Launch1-NargExecutable
    MATCH   tag == 0x00000120;
    TYPE Launch1argExecutable
    MATCH   tag == 0x00000101;
    TYPE Launch2argExecutable
    MATCH   tag == 0x00000102;

Same as “GenericWindowedExecutable,” except that it runs `launch` to allow user to enter options prior to running the command. These file types are defined in `/usr/lib/filetype/system/sgicmds.ftr`.

### ttyExecutable

    TYPE ttyExecutable
    MATCH   (tag == 0x00000400) || (tag == 0x00000410);
    TYPE tty1-NargExecutable
    MATCH   tag == 0x00000420;
    TYPE tty2argExecutable
    MATCH   tag == 0x00000402;

Runs the command in a window that allows terminal I/O. The output window (which is where the terminal emulation is being done) exits immediately upon termination of the command. These file types are defined in `/usr/lib/filetype/system/sgicmds.ftr`.

### ttyLaunchExecutable

    TYPE ttyLaunchExecutable
    MATCH   tag == 0x00000500;
    TYPE ttyLaunch1-NargExecutable
    MATCH   tag == 0x00000520;
    TYPE ttyLaunch1argExecutable
    MATCH   tag == 0x00000501;

Same as “ttyExecutable,” except that it runs `launch` to allow user to enter options before running the command. These file types are defined in `/usr/lib/filetype/system/sgicmds.ftr`.

### ttyOutExecutable

    TYPE ttyOutExecutable
    MATCH   (tag == 0x00000600) || (tag == 0x00000610);
    TYPE ttyOut1-NargExecutable
    MATCH   tag == 0x00000620;
    TYPE ttyOut1argExecutable
    MATCH   tag == 0x00000601;
    TYPE ttyOut2argExecutable
    MATCH   tag == 0x00000602;

Same as “ttyExecutable,” except that the output window persists until the user explicitly dismisses it. These file types are defined in `/usr/lib/filetype/system/sgicmds.ftr`.

### ttyLaunchOutExecutable

    TYPE ttyLaunchOutExecutable
    MATCH   (tag == 0x00000700) || (tag == 0x00000710);
    TYPE ttyLaunchOut1-NargExecutable
    MATCH   tag == 0x00000720;
    TYPE ttyLaunchOut1argExecutable
    MATCH   tag == 0x00000701;
    TYPE ttyLaunchOut2argExecutable
    MATCH   tag == 0x00000702;
    TYPE ttyLaunchOut3argExecutable
    MATCH   tag == 0x00000703

Same as “ttyOutExecutable,” except that it runs `launch` to allow user to enter options before running the command. These file types are defined in `/usr/lib/filetype/system/sgicmds.ftr`.

Prev | Table of Contents | Next
Appendix D. The Icon Description Language |  | Appendix F. FTR File Directories