Carbon


FSSetForkSize

Header: Files.h Carbon status: Supported

Changes the size of an open fork.

OSErr FSSetForkSize (
    SInt16 forkRefNum, 
    UInt16 positionMode, 
    SInt64 positionOffset
);
forkRefNum

The reference number of the fork

positionMode

The base location for the new size

positionOffset

The offset of the new size from the base

function result

A result code. If there is not enough space on the volume to extend the fork, then dskFulErr is returned and the fork’s size is unchanged.

DISCUSSION

The logical end-of-file will be set to the position indicated by the positionMode and positionOffset parameters.

The fork’s new size may be less than, equal to, or greater than the fork’s current size. If the fork’s new size is greater than the fork’s current size, then the additional bytes (between the old and new size) will have an undetermined value.

If the fork’s current position is larger than the fork’s new size, then the current position will be set to the new fork size. That is, the current position will be equal to the logical end of file.

AVAILABILITY

Supported in Carbon. Available in Mac OS 9, and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)