Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Notes > Legacy Documents > Mac OS 9 & Earlier >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

New Resource Manager Calls

CONTENTS

This Technical Note describes two new Resource Manager calls that make opening and creating resource files much easier.

[Oct 01 1988]






Introduction

MPW 3.0 supplies glue routines for two new Resource Manager calls which provide new, easier ways of opening and creating resource files.

The important thing about these two calls is that they allow you to pass a directory ID instead of a working directory refNum. This means that you can create a resource file without worrying about the Poor Man's Search Path (PMSP). If you try to create a file using _CreateResFile, and there is already a resource file with the same name in the System Folder (or in any other folder that is on the PMSP's list), the _CreateResFile call will not work because the Resource Manager thinks the resource file already exists. The all new HCreateResFile glue does not use the PMSP if you specify a non-zero directory ID.

FUNCTION HOpenResFile(vRefNum: INTEGER;
            dirID: LONGINT;
            fileName: Str255;

The HOpenResFile routine opens an existing resource file in the directory specified by vRefNum and dirID and it returns the refNum of the resource file. If the refNum equals -1, you should call _ResError to check for errors. This routine also lets you open a resource file without creating a working directory.

PROCEDURE HCreateResFile(vRefNum: INTEGER;
    dirID: LONGINT;

The HCreateResFile routine creates a new resource file with name fileName in the directory specified by vRefNum and dirID. You should call _ResError to check for errors.



Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (40K).

Download