SetResourceSize
SetResourceSize Set size of a resource (without writing data)
#include <Resources.h> Resource Manager
void SetResourceSize(theResource, size);
Handle theResource ; 4-byte ResType; resource type to get
long size ; size value
The SetResourceSize procedure sets the size of a resource without writing
data. You can change the size of any resource, regardless of the amount of
memory you have available. Note that if you make the resource smaller, you
lose any data at the end of that resource.
The parameter theResource is a handle that specifies the resource on disk. The
value of the size parameter is the size you want the resource to occupy on disk,
in bytes. If you set the size smaller than it was, you lose any data at the end of
the resource. If the size is set larger, all data is p reserved, but the enlarged
area is un initialized. Call ResError to check for errors.
If the disk is locked or full, or the file is locked, ResError returns the
appropriate file system error. If the resource is in memory, the
Resource Manager tries to set the size of the resource on disk. If the
attempt is successful, ResError returns the resourceInMemory result code
and does not update the copy in memory. If it is not successful, ResError
returns the appropriate file system error.
Returns: an Error Code. It will be one of:
resourceInMemory (-188) Resource already in memory
writingPastEnd (-189) Writing past end of file