Important: The information in this document is obsolete and should not be used for new development.
Resource Manager Routines
This section describes the routines provided by the Resource Manager. You can use these routines to create, open, and close resource forks; get and set the current resource file; read resources into memory; get and set resource information; modify resources; write
to resource forks on disk; get a unique resource ID; count and list resource types; get resource sizes; dispose of resources; read and write partial resources; get and set resource fork attributes; and access resource entries in the resource map.The
FSpCreateResFile
procedure and theFSpOpenResFile
function use a file system specification (FSSpec
) record. These routines are available only in System 7 or later. Use theGestalt
function to determine if these routines are available. If they're not available, you can call the equivalent File Manager HFS routines, theHCreateResFile
procedure and theHOpenResFile
function.The Resource Manager provides a means for reporting errors specifically related to resources. After calling a Resource Manager routine, you can call the
ResError
function to determine whether any error occurred. TheResError
function returns an integer value identifying any error reported by the Resource Manager routine that was executed last. The values listed in theResError
description signify only those errors dealing specifically with resources. TheResError
function can also return values corresponding to Operating System result codes. The description for each Resource Manager routine includes the errorsResError
may report for that routine under the subheading "Result Codes"; this list includes both the integer result codes for the Resource Manager routine as well as common Operating System result codes.
Subtopics
- Initializing the Resource Manager
- Checking for Errors
- Creating an Empty Resource Fork
- Opening Resource Forks
- Getting and Setting the Current Resource File
- Reading Resources Into Memory
- Getting and Setting Resource Information
- Modifying Resources
- Writing to Resource Forks
- Getting a Unique Resource ID
- Counting and Listing Resource Types
- Getting Resource Sizes
- Disposing of Resources
- Closing Resource Forks
- Reading and Writing Partial Resources
- Getting and Setting Resource Fork Attributes
- Accessing Resource Entries in a Resource Map