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 / Reading, Writing, and Closing Files


PBClose

You can use the PBClose function to close an open file.

FUNCTION PBClose (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.

DESCRIPTION
The PBClose function writes the contents of the access path buffer specified by the ioRefNum field to the volume and removes the access path.

WARNING
Some information stored on the volume won't be updated until PBFlushVol is called.
WARNING
Do not call PBClose with a file reference number of a file that has already been closed. Attempting to close the same file twice may result in loss of data on a volume. See "File Control Blocks" on page 2-81 for a description of how this can happen.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro for PBClose is _Close.

RESULT CODES
noErr0No error
ioErr-36I/O error
fnOpnErr-38File not open
fnfErr-43File not found
rfNumErr-51Bad reference number

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996