Important: The information in this document is obsolete and should not be used for new development.
GetMaxResourceSizeYou can use the
GetMaxResourceSizefunction to get the approximate size of a resource. The
GetMaxResourceSizefunction is also available as the
FUNCTION GetMaxResourceSize (theResource: Handle): LongInt;
- Handle to a resource.
GetMaxResourceSizetakes a handle and returns the size of the corresponding resource. However,
GetMaxResourceSizedoes not check the resource on disk; instead, it either checks the resource size in memory or, if
the resource is not in memory, calculates its size, in bytes, on the basis of information
in the resource map in memory. This gives you an approximate size for the resource that you can count on as the resource's maximum size. It's possible that the resource is actually smaller than the offsets in the resource map indicate because the file has not yet been compacted. If you want the exact size of a resource on disk, either call
If the value of the
theResourceparameter isn't a handle to a valid resource,
GetMaxResourceSizereturns -1, and
ResErrorreturns the result code
noErr 0 No error resNotFound -192 Resource not found
SEE ALSOTo check for errors, call the
ResErrorfunction as described on page 1-47.
For a description of the
GetResourceSizeOnDiskroutines, see page 1-87 and page 1-99, respectively.