Carbon


GetResourceSizeOnDisk

Header: Resources.h Carbon status: Supported

Returns the exact size of a resource.

SInt32 GetResourceSizeOnDisk (
    Handle theResource
);
Parameter descriptions
theResource

A handle to the resource whose size you wish to retrieve.

function result

The exact size, in bytes, of the resource. If the handle isn’t a handle to a valid resource, the function returns –1, and the ResError function returns the result code resNotFound.

DISCUSSION

This function checks the resource on disk, not in memory. You can call this function before reading a resource into memory to make sure there’s enough memory available to do so successfully.

The GetResourceSizeOnDisk function is also available as the SizeResource function.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)