HGetFInfo
HGetFInfo Obtain file type, creator, icon position, etc.
#include <Files.h> File Manager
OSErr HGetFInfo( vRefNum, dirID, fileName, fndrInfo );
short vRefNum; volume or working directory reference
long dirID; directory ID
Str255 fileName; address of length-prefixed full or partial name
FInfo *fndrInfo; address of a 16-byte FInfo structure
returns Error Code; 0=no error
HGetFInfo obtains a copy of the 16-byte packet of de scriptive information
maintained for the Finder. This includes the file's type, the signature of its
creator, Finder flags (such as whether the icon is displayed or is actually on
the desktop), and the display position of the file's icon within its folder
( window).
vRefNum is the reference number of the volume or working directory that
contains the file or directory fileName. 0 indicates the default
volume.
dirID is the directory ID that contains the file to get info about
fileName is the address of a length-prefixed, pascal-style string containing
the name of the file of interest. It may be a partial or full pathname,
depending upon the value of vRefNum .
fndrInfo is the address of a 16-byte FInfo structure. Upon return, it is
filled with file-specific information used by the Finder.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
bdNamErr (-37) Bad name
extFSErr (-58) External file system
fnfErr (-43) File not found
ioErr (-36) I/O error
paramErr (-50) No default volume

Notes: The FInfo structure maintains the primary information used by the Finder
in locating the icon to display, where to display it and which application to
run when its icon is double-clicked. It is the same information as in the
ioFlFndrInfo field of the FileParam structure, which is passed to custom
"file filters" used in the Standard File Package (see SFGetFile).
Additional Finder information is maintained in an FXInfo structure, which
can be obtained via PBGetCatInfo. Use SetFInfo, PBSetFInfo, or
PBSetCatInfo to modify the Finder information (and other information
about a file).
If your application rewrites files by deleting the original and creating a
new one, you should maintain the position on the file's icon within its folder.