Important: The information in this document is obsolete and should not be used for new development.
GetResourceSizeOnDisk
You can use theGetResourceSizeOnDisk
function to get the exact size of a resource. TheGetResourceSizeOnDisk
function is also available as theSizeResource
function.
FUNCTION GetResourceSizeOnDisk (theResource: Handle): LongInt;
theResource
- A handle to a resource.
DESCRIPTION
Given a handle to a resource, theGetResourceSizeOnDisk
function checks the resource on disk (not in memory) and returns its exact size, in bytes. If the handle isn't a handle to a valid resource,GetResourceSizeOnDisk
returns -1, andResError
returns the result coderesNotFound
.You can call
GetResourceSizeOnDisk
before reading a resource into memory to make sure there's enough memory available to do so successfully.RESULT CODES
noErr 0 No error resNotFound -192 Resource not found SEE ALSO
To check for errors, call theResError
function as described on page 1-47.