Important: The information in this document is obsolete and should not be used for new development.
CloseResFileYou can use the
CloseResFileprocedure to close a resource fork before your application terminates.
PROCEDURE CloseResFile (refNum: Integer);
- The file reference number for the resource fork to close.
DESCRIPTIONGiven a file reference number for a file whose resource fork is open, the
CloseResFileprocedure performs four tasks. First, it updates the file by calling the
UpdateResFileprocedure. Second, it releases the memory occupied by each resource in the resource fork by calling the
DisposeHandleprocedure. Third, it releases the memory occupied by the resource map. The fourth task is to close the resource fork.
refNumparameter does not contain a file reference number for a file whose resource fork is open,
CloseResFiledoes nothing, and the
ResErrorfunction returns the result code
resFNotFound. If the value of the
refNumparameter is 0, it represents the System file and is ignored. You cannot close the System file's resource fork.
When your application terminates, the Resource Manager automatically closes every resource fork open to your application except the System file's resource fork. You need to call the
CloseResFileprocedure only if you want to close a resource fork before your application terminates.
noErr 0 No error resFNotFound -193 Resource file not found
SEE ALSOTo check for errors, call the
ResErrorfunction as described on page 1-47.
For an example of the use of the
CloseResFileprocedure, see Listing 1-9 on page 1-26.
For descriptions of the
ReleaseResourceprocedures, see page 1-87 and page 1-101, respectively.