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 / Manipulating the File Mark


PBSetFPos

You can use the PBSetFPos function to position the file mark before reading from or writing to an open file.

FUNCTION PBSetFPos (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.
-->ioPosModeIntegerThe positioning mode.
<->ioPosOffsetLongIntOn input, the positioning offset. On output, the position at which the mark was actually set.

DECRIPTION
The PBSetFPos function sets the mark of the specified file to the position specified by the ioPosMode and ioPosOffset fields. If you try to set the mark past the logical end-of-file, PBSetFPos moves the mark to the end-of-file and returns eofErr as its function result.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for PBSetFPos is _SetFPos.

RESULT CODES
noErr0No error
ioErr-36I/O error
fnOpnErr-38File not open
eofErr-39Logical end-of-file reached
posErr-40Attempt to position mark before start of file
rfNumErr-51Bad reference number
extFSErr-58External file system

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996