|
![]() |
![]() |
version 2003
PA_UpdateResFile (resfile)
Parameter | Type | Description | |
resfile | short | → | File reference number of the file to access |
Description
The routine
PA_UpdateResFile
writes all changed resource data to disk and updates the necessary index and resource map.
This routine should be called to force "disk write" of modified or newly created resources.
It can be called every time a resource is modified or after many changes. Updating the resource file ensures that it will maintain its integrity in the event of a disk crash (just like the
WRITE BUFFER
command that flushes data).
Example
Create three resources and update the file immediately.
typedef struct {
short f1;
short f2;
short f3;
}FOO, *FOOptr, **FOOhdle;
FOO aStruct = {1, 2, 3};
// Add the resources...
PA_CreateResource(resFile, 'FOO ', -1, (char *) &aStruct, sizeof(FOO));
aStruct.f1 += 10;
aStruct.f2 += 10;
aStructf.f3 += 10;
PA_CreateResource(resFile, 'FOO ', -1, (char *) &aStruct, sizeof(FOO));
aStruct.f1 += 100;
aStruct.f2 += 100;
aStructf.f3 += 100;
PA_CreateResource(resFile, 'FOO ', -1, (char *) &aStruct, sizeof(FOO));
// ... update the file
PA_UpdateResFile(resFile);
See Also
No reference.
Error Handling
always returns
eER_NoErr