Important: The information in this document is obsolete and should not be used for new development.
Allocate
You can use theAllocate
function to allocate additional blocks to an open file.
FUNCTION Allocate (refNum: Integer; VAR count: LongInt): OSErr;
refNum
- The file reference number of an open file.
count
- On input, the number of additional bytes to allocate to the file; on output, the number of bytes actually allocated, rounded up to the nearest multiple of the allocation block size.
DESCRIPTION
TheAllocate
function adds the specified number of bytes to the specified file and sets the physical end-of-file to 1 byte beyond the last block allocated. If there isn't enough empty space on the volume to satisfy the allocation request,Allocate
allocates the rest of the space on the volume and returnsdskFulErr
as its function result.The
Allocate
function always attempts to allocate contiguous blocks. If the total number of requested bytes is unavailable,Allocate
allocates whatever space, contiguous or not, is available. To force the allocation of the entire requested space as a contiguous piece, callAllocContig
instead.RESULT CODES