Carbon


Resource Fork Attribute Mask Constants

Header: Resources.h

enum {
    resSysRefBit = 7,
    resSysHeapBit = 6,
    resPurgeableBit = 5,
    resLockedBit = 4,
    resProtectedBit = 3,
    resPreloadBit = 2,
    resChangedBit = 1,
    mapReadOnlyBit = 7,
    mapCompactBit = 6,
    mapChangedBit = 5
};

Constant descriptions

resSysRefBit
resSysHeapBit
resPurgeableBit
resLockedBit
resProtectedBit
resPreloadBit
resChangedBit
mapReadOnlyBit

If this attribute is set to 1, the Resource Manager doesn’t write anything to the resource fork on disk. It also doesn’t check whether the resource data can be written to disk when the resource map is modified. When this attribute is set to 1, the UpdateResFile and WriteResource functions do nothing, but the function ResError returns the result code noErr.

If you set the mapReadOnly attribute but later clear it, the resource data is written to disk even if there’s no room for it. This operation may destroy the resource fork.

mapCompactBit

If this attribute is set to 1, the Resource Manager compacts the resource fork when it updates the file. The Resource Manager sets this attribute when a resource is removed or when a resource is made larger and thus must be written at the end of a resource fork. You may want to set the mapCompact attribute to force the Resource Manager to compact a resource fork when your changes have made resources smaller.

mapChangedBit

If this attribute is set to 1, the Resource Manager writes the resource map to disk when the file is updated. For example, you can set mapChanged if you’ve changed resource attributes only and don’t want to call the ChangedResource function because you don’t want to write the resource data to disk.

The GetResAttrs function uses the following masks to test the attributes it returns, while the SetResAttrs function uses the following masks to set the attribute bits in the attrs parameter.


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