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: More Macintosh Toolbox /
Chapter 1 - Resource Manager / Resource Manager Reference


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 the FSpOpenResFile function use a file system specification (FSSpec) record. These routines are available only in System 7 or later. Use the Gestalt function to determine if these routines are available. If they're not available, you can call the equivalent File Manager HFS routines, the HCreateResFile procedure and the HOpenResFile 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. The ResError function returns an integer value identifying any error reported by the Resource Manager routine that was executed last. The values listed in the ResError description signify only those errors dealing specifically with resources. The ResError function can also return values corresponding to Operating System result codes. The description for each Resource Manager routine includes the errors ResError 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

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996