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 / Finder Interface Reference
Data Structures


File Information Record

You typically set a file's type and creator when you create the file; for example, you pass a creator and a file type to the File Manager function FSpCreate as parameters. The Finder manipulates the other fields in the file information record, which is a data structure of type FInfo. After you have created a file, you can use the File Manager function FSpGetFInfo to return the file information record, then change the fdType and fdCreator fields by using the File Manager function FSpSetFInfo.

TYPE  FInfo =
      RECORD
         fdType:     OSType;     {file type}
         fdCreator:  OSType;     {file creator}
         fdFlags:    Integer;    {Finder flags}
         fdLocation: Point;      {file's location in window}
         fdFldr:     Integer;    {window that contains file}
      END;
Field Description
fdType
File type. For a discussion of file types, see "Giving a Signature to Your Application and a Creator and a File Type to Your Documents" beginning on page 7-7.
fdCreator
The signature of the application that created the file. For a discussion about creators, see "Giving a Signature to Your Application and a Creator and a File Type to Your Documents" beginning on page 7-7.
fdFlags
Finder flags. There are only a few flags that your application might ever need to set; these are described in "Using Finder Information in the Catalog File" beginning on page 7-30. All of the Finder flags are listed here for completeness.
Flag nameBit
number
Description
isAlias15For a file, this bit indicates that the file
is an alias file. For directories, this bit is reserved--in which case, set to 0.
isInvisible14The file or directory is invisible from the Finder and from the Standard File Package dialog boxes.
hasBundle13For a file, this bit indicates that the file contains a bundle resource. For directories, this bit is reserved--in which case, set to 0.
nameLocked12The file or directory can't be renamed from the Finder, and the icon cannot be changed.
isStationery11For a file, this bit indicates that the file is a stationery pad. For directories, this bit is reserved--in which case, set to 0.
hasCustomIcon10The file or directory contains a
customized icon.
Reserved9Reserved; set to 0.
hasBeenInited8The Finder has recorded information from the file's bundle resource into the desktop database and given the file or folder a position on the desktop.
hasNoINITS7The file contains no 'INIT' resources; set to 0. Reserved for directories; set to 0.
isShared6The file is an application that can be executed by multiple users simultaneously. Defined only for applications; otherwise, set to 0.
requiresSwitchLaunch5Unused and reserved in System 7; set to 0.
colorReserved4Unused and reserved in System 7; set to 0.
color1-3Three bits of color coding.
isOnDesk0Unused and reserved in System 7; set to 0.
You can use these constants as masks for these flags:
               CONST
               fHasBundle  =  8192;    {set if file has a bundle }
                                       { resource}
               fInvisible  =  16384;   {set if icon is invisible}
               kIsOnDesk   =  $1;      {unused and reserved in }
                                       { System 7}
               kColor      =  $E;      {three bits of color }
                                       { coding}
               kIsShared   =  $40;     {file can be executed by }
                                       { multiple users }
                                       { simultaneously}
               kHasBeenInited 
                           =  $100;    {file info is in desktop }
                                       { database}
               kHasCustomIcon
                           =  $400;    {file or directory has a }
                                       { customized icon}
               kIsStationery
                            = $800;    {file is a stationery pad}
               kNameLocked =  $1000;   {file or directory can't }
                                       { be renamed from Finder, }
                                       { and icon can't be }
                                       { changed}
               kHasBundle  =  $2000;   {file has bundle resource}
               kIsInvisible=  $4000;   {file or directory is }
                                       { invisible from Finder & }
                                       { from Standard File }
                                       { Package dialog boxes}
               kIsAlias    =  $8000;   {file is an alias file}
fdLocation
The location--specified in coordinates local to the window--of the file's icon within its window.
fdFldr
The window in which the file's icon appears; this information is meaningful only to the Finder.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996