HSetFInfo
HSetFInfo Change file type, creator, icon position, etc.
#include <Files.h> File Manager
OSErr HSetFInfo( 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
HSetFInfo changes Finder-specific information about a file. This includes
the file's type, the signature of its creator, Finder flags (such as whether the
icon is displayed), and the display position of the file's icon within its window.
vRefNum is the reference number of the volume or working directory
containing the file or directory fileName. 0 indicates the default
volume.
dirID is the ID of the directory that contains the file to set info about
fileName is the address of a length-prefixed, pascal-style string containing
the name of the target file. It may be a partial or full pathname,
depending upon the value of vRefNum .
fndrInfo is the address of a 16-byte FInfo structure containing the desired
values of Finder specific information to be changed. Normal usage is
to pre-set all fields with current values by first calling GetFInfo,
then change only those fields you wish to modify.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
extFSErr (-58) External file system
fLckdErr (-45) File is locked
fnfErr (-43) File not found
ioErr (-36) I/O error
nsvErr (-35) No such volume
vLckdErr (-46) Volume is locked
wPrErr (-44) Diskette is write-protected

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 the
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. In all operations where you modify
file-de scriptive information, the normal usage is to obtain a copy of the
current information before modifying selected fields and updating the disk.