Important: The information in this document is obsolete and should not be used for new development.
GetResourceSizeOnDisk
You can use theGetResourceSizeOnDiskfunction to get the exact size of a resource. TheGetResourceSizeOnDiskfunction is also available as theSizeResourcefunction.
FUNCTION GetResourceSizeOnDisk (theResource: Handle): LongInt;
theResource- A handle to a resource.
DESCRIPTION
Given a handle to a resource, theGetResourceSizeOnDiskfunction 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,GetResourceSizeOnDiskreturns -1, andResErrorreturns the result coderesNotFound.You can call
GetResourceSizeOnDiskbefore 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 theResErrorfunction as described on page 1-47.
 
  
  
 