Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 2 - File Manager / File Manager Reference
Low-Level File Access Routines / Allocating File Blocks


PBAllocContig

You can use the PBAllocContig function to allocate additional contiguous blocks to an open file.

FUNCTION PBAllocContig (paramBlock: ParmBlkPtr; async: Boolean): 
                        OSErr;
paramBlock
A pointer to a basic File Manager parameter block.
async
A Boolean value that specifies asynchronous (TRUE) or synchronous (FALSE) execution.
-->ioCompletionProcPtrA pointer to a completion routine.
<--ioResultOSErrThe result code of the function.
-->ioRefNumIntegerA file reference number.
-->ioReqCountLongIntThe number of bytes requested.
<--ioActCountLongIntThe number of bytes allocated, rounded up to the nearest multiple
of the allocation block size.

DESCRIPTION
The PBAllocContig function is identical to the PBAllocate function except that if there isn't enough contiguous empty space on the volume to satisfy the allocation request, PBAllocContig does nothing and returns dskFulErr as its function result. If you want to allocate whatever space is available, even when the entire request cannot be filled by the allocation of a contiguous piece, call PBAllocate instead.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for PBAllocContig is _AllocContig.

RESULT CODES
noErr0No error
dskFulErr-34Disk full
ioErr-36I/O error
fnOpnErr-38File not open
wPrErr-44Hardware volume lock
fLckdErr-45File is locked
vLckdErr-46Software volume lock
rfNumErr-51Bad reference number
wrPermErr-61Read/write permission doesn't allow writing

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996