- 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.
| --> | ioCompletion | ProcPtr | A pointer to a completion routine. |
| <-- | ioResult | OSErr | The result code of the function. |
| --> | ioRefNum | Integer | A 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
| noErr | 0 | No error |
| ioErr | -36 | I/O error |
| fnOpnErr | -38 | File not open |
| fnfErr | -43 | File not found |
| rfNumErr | -51 | Bad reference number |
© Apple Computer, Inc.
2 JUL 1996