Zeus Tech Note
File Types, Creator Codes
and Extensions
(This document last revised June 7, 1997)
Copyright © 1996-1997. Zeus
Productions. All Rights Reserved.
Written by Bruce A. Epstein
What is a File Type and Why Do I Care?
- There are many different types of files, such as application programs,
documents and data files, or system utilities and drivers. A file's format
must be known in order for a program or the OS to interpret it correctly.
For example, a PICT file could not be read as if it were text by a word
processor, but it might be recognized by a paint program. PCs and Macs have
different conventions for indicating a file's format.
How do DOS/Windows use File Extensions?
- Under DOS and Windows 3.1, file names are limited to eight characters,
followed by a period (.) followed by a maximum of a 3-character extension.
This extension is used to indicate the type of the file, although this is
not universally reliable. For example, the ".TXT" extension indicates
a text file. Windows 95 allows for longer filenames, but the three letter
extension convention is still used heavily. Windows 95 files can also have
a hidden file type, such as "htmlfile" which is similar to a Macintosh
File Type (see below).
- The associations between file extensions and applications are stored
in the Windows WIN.INI file and the Windows Registry file. Refer to the
TechNote, "Using Windows
INI Files"
- There are two main limitations to this system:
- A file must be named with a particular extension to be interpreted
properly. Changing the name of the file will prevent it from working, in
some cases.
- Any given file extension can only be associated with a single application.
Thus, if you double-click on any TXT file, it will always be opened with
the same application.
What are Macintosh File Types and Creator
Codes?
- Each Macintosh file contains a hidden File Type and Creator Code that
indicate the file's format and the application that uses it, independent
of the file's name. Every Macintosh application has a unique Creator
Code. Apple maintains a registry of these Creator Codes to avoid conflicts
between vendors. Most document formats have a unique File Type, but not
always. Most notably. HTML files use the plain text type "TEXT"
and are not identified as HTML files per se.
- When you double-click a document, the Macintosh Finder searches for
the application identified by the file's Creator Code. If it can't find
the associated application, the Mac will list other applications that claim
to recognize files of the specified File Type. An application interprets
a document based on this File Type, such as "TEXT". (Applications
all have a File Type of "APPL" which is analagous to the Windows
.EXE extension, and tells the Finder that it is an executable).
- An application may recognize more than one File Type. For example,
deBabelizer can read many graphic file formats, each which have a unique
File Type. You can open a document from within any application that understands
that document's format, using the File menu's Open command.
- Note that File Types and Creator Codes are always exactly four
(4) characters and are case-sensitive. Some File Types and Creator Codes
have trailing spaces to pad them out to four characters. You can view a
file's File Type and Creator Code with several utilities, such as ResEdit
or DropInfo.
- There are two main advantages to this system:
- Files can be named freely without regard to their format, but Macintosh
files are often named with an extension for convenience. For example web
pages have an .HTM or .HTML extension.
- Documents of a given File Type do not all have to be associated with
the same application. A TEXT file can be associated with either SimpleText
or Microsoft Word, by virtue of the Creator Code.
There main disadvantages to this system:
- Files may lose their File Type and Creator Codes when transported
over the internet or a network, especially when copied to/from non-Macintosh
computers. Sometimes they are assigned generic or unknown File Types and
Creator Codes, but these can be modified with ResEdit or DropInfo.
- To change the application with which a document is associated, you
must change the document's Creator Code. For example, there is no easy way
to force all TEXT files to be opened with a single word processor when they
are double-clicked.
Other Caveats:
- File Types and Creator Codes are always exactly four (4) characters
and are case-sensitive. Beware of trailing spaces, mistaking zeros for
ohs, and special characters which are sometimes used for Creator Codes.
- Sometimes multiple applications will use the same Creator Code. For
example, "ttxt" is used by both TeachText and SimpleText, "CARO"
is used by both Adobe Acrobat Reader and Adobe Acrobat Exchange, and "StMl"
is used by both Adobe PageMill and Adobe SiteMill.
- When an application is upgraded, the vendor may use the same Creator
Code. Thus it is difficult to ensure that the latest version of software
is opened automatically. Deleting extraneous versions of the software should
help.
- HTML files use the "TEXT" File Type and do not have a unique
file type unto themselves.
How do File Formats vary across platforms?
- Some file formats are supported primarily on one of the two major
platforms, whereas others are cross-platform. Some formats, such as PICT,
TEXT and GIF can be read by numerous applications, while other formats are
highly application-specific.
- Note that many Macintosh applications will open files with a recognizable
extensions. For example, Director for Macintosh can open DIR files with
the File menu's Open command, even if the file's File Type is not set properly.
- Some file extensions indicate that a file has been processed or encoded
with one or more compression or encoding programs. These are generally used
when transferring files via the internet.
How do I determine the File Type and Creator
Code of a Macintosh File?
- From the Finder, use ResEdit's Get Info command to inspect or change
a file's Type and Creator. Other utilities, such as DropInfo provide the
same capability.
- From within Director, the FileIO Xtra's
getFinderInfo
method will return a file's File Type and Creator Code. Because a method
can only return one thing, FileIO returns them both in one string, from
which you can manually extract the Type and Creator. The first four characters
are the Type and the last four characters are the Creator.
- Warning:
getFinderInfo
seems to crash Director, so you
may want to use the older FileIO XObject instead (see below)
- When using the FileIO Xtra:
set fileXtra = new (Xtra "FileIO")
openFile (fileXtra, filename, mode)
set typeCreator = getFinderInfo (fileXtra)
set type = char 1 to 4 of typeCreator
set creator = char 5 to 8 of typeCreator
- When using the FileIO XObject:
set fileObj = FileIO (mNew, fileName, mode)
set typeCreator = fileObj (mGetFinderInfo)
set type = char 1 to 4 of typeCreator
set creator = char 5 to 8 of typeCreator
What does a return value from getFinderInfo/mGetFinderInfo
of "TEXT????" or "TEXT " indicate?
- "TEXT" is the File Type and "???" is an unknown
or missing Creator Code. Macintosh files that have been download or were
transferred from a different platform may not have their Type and Creator
set properly.
How do I set the File Type and Creator Code
of a file?
- From the Finder, use ResEdit's Get Info command to inspect or change
a file's Type and Creator. Other utilities, such as DropInfo provide the
same capability.
- From within Director, the FileIO Xtra's
setFinderInfo
method will set a file's File Type and Creator Code. Note that the Type
and Creator are passed within a single string, and a dummy character, such
as a space is required between them. Note that this seems to crash on
my 68K Mac!
- When using the FileIO Xtra:
set fileXtra = new (Xtra "FileIO")
openFile (fileXtra, filename, mode)
set type = "TEXT"
set creator = "ttxt"
setFinderInfo (fileXtra, type && creator)
- When using the FileIO XObject, the Type and Creator are separate parameters:
-
set fileObj = FileIO (mNew, filename, mode)
set type = "TEXT"
set creator = "ttxt"
fileObj (mSetFinderInfo,type, creator)
Creator Codes for Common Applications:
Adobe Acrobat Reader "CARO" (all upper case. Also used
by Acrobat Exchange. The fourth character is a Capital Oh, not a zero)
Netscape Navigator 3.0 - "MOSS " (All upper case. The second
character is a Capital Oh, not a zero)
SimpleText "ttxt" (all lower case. This was also used by
TeachText)
Common File Types (alphabetical)
AIF - AIFF audio file, Mac and PC
AVI - Video for Windows Digital Video (Audio Video Interleaved)
BMP - Bitmap
DCR - Compressed Director Movie
DDB - Device-Dependent Bitmap. See BMP, DIB
DIB - Device Independent Bitmap. See BMP, DDB
DIR - Director movie
DXR - Protected Director movie
EPS - Encapsulated PostScript
FLC - Animation sequence (from AutoCAD?)
FLI - Animation sequence (from AutoCAD?)
GIF - Graphics Interchange Format
JPEG - Compressed PICTs
JPG - Compressed PICTs
MOV - QuickTime Digital Video
PAL - Palettes
PCD - Photo CD files
PCT - PICT file
PCX - PaintBrush Files (PC)
PIC - PICT file
PICT - PICT file
PNT - MacPanit format
TIFF - Tagged Image File Format - popular for scanned photos
WAV - audio fiile. primarily PC, but also Mac
WMF - Windows Metafiles
Common File Types and their Applications:
Listed below are some of the most common file types and the applications
with which they are usually associated. These associations are usually set
up when an application is installed, but can also be changed by the user.
Web Browser File Types
HTM, - Web browser, such as
HTML - Netscape Navigator or
"htmlfile" - Microsoft Internet Explorer
URL - Internet Shortcut
Business Applications File Types
xls - Microsoft Excel Spreadsheet
"excel.sheet.5" - Microsoft Excel Spreadsheet
Compression File Types
A comprehensive list of compression formats and filename extensions, and
information about finding software to decompress the formats can be found
at ftp.cso.uicu.edu/doc/pcnet/compression
.zip - IBM zip archive
.sit - Mac stuffit archive
.gz - GNUZip Compress (UNIX) (see GZIP for the Mac or WINZIP for Windows to decompress)
.hqx - BinHex file (encoded for file transfers, must be decoded - Mac)
.z - UNIX compressed file
Image File Types
.GIF - Graphics Interchange Format, a common web page format
.JPG or JPEG - Joint Photographic Experts Group graphics file format, a common web page format
.BMP - Windows BitMaP picture file, Microsoft Paint, et al.
.PICT - Macintosh PICTure format
Sound File Types
AIF or AIFF - Audio Interchange Format File
au - Audio file
mid - Musical Interval Digital Interface format
wav - Wave file
Word Processing File Types
DOC - Microsoft WordPad or Word
TXT - Microsoft WordPad, NotePad or Write
WRI - Microsoft WordPad, NotePad or Write
W6BN" - Word Six Binary (I assume) Type
"RTF " - Rich Text Format (note trailing space in four-character File Type)
PDF - (Portable Document File format) Adobe Acrobat Reader
Director 5 File Types and Creators
MD93 - Director 4.0 Application (Creator Code, not File Type)
MV93 - Director 4.0 DIR movie files
Director 5 Application Typ "APPL" Creator "MD95"
Director 5 Resources Type "DsJt" Creator "MD95"
Director 5 DIR movie files Type"MV95" Creator "MD95"
Xtras files Type "Xtra" Creator "Xown"
Include .H files Type "TEXT" Creator "MPS "
Source .C files Type "TEXT" Creator "MPS "
Resource . rsrc files Type "RSRC" Creator "RSED"
The files types that Director will import are:
Windows Bitmaps (.BMP,.DIB)
Windows Metafiles (.WMF)
Palettes (.PAL)
Sounds (.WAV,.AIF)
Director movies (.DIR)
Digital Video (.MOV, .AVI)
Macintosh PICTs (.PCT, .PIC)
TIFF files (.TIF)
Encapsulated Postscript (.EPS)
PC Paintbrush files (.PCX)
GIF files (.GIF)
Photo CD files (.PCD)
Animator Movies (.FLC, .FLI)
MacPaint files (.PNT)
QT Compressed PICT's (.JPG)
Director for Windows will export Bitmap (.BMP) files.
Director for Macintosh will export PICT or MOV (QuickTime) files.
Home (Spotlight) | Table
of Contents | Links | Contact
Info
Place an Order | Products
for Sale | Licensing | Downloads
TechNotes | FAQs
| E-Mail Zeus | GuestBook
| Glossary
Copyright © 1996-1997. Zeus
Productions. All Rights Reserved.