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
FSpCreateResFileprocedure and theFSpOpenResFilefunction use a file system specification (FSSpec) record. These routines are available only in System 7 or later. Use theGestaltfunction to determine if these routines are available. If they're not available, you can call the equivalent File Manager HFS routines, theHCreateResFileprocedure and theHOpenResFilefunction.The Resource Manager provides a means for reporting errors specifically related to resources. After calling a Resource Manager routine, you can call the
ResErrorfunction to determine whether any error occurred. TheResErrorfunction returns an integer value identifying any error reported by the Resource Manager routine that was executed last. The values listed in theResErrordescription signify only those errors dealing specifically with resources. TheResErrorfunction can also return values corresponding to Operating System result codes. The description for each Resource Manager routine includes the errorsResErrormay 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