Important: The information in this document is obsolete and should not be used for new development.
PBWrite
You can use thePBWritefunction to write any number of bytes to an open file.
FUNCTION PBWrite (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. --> ioBufferPtrA pointer to a data buffer. --> ioReqCountLongIntThe number of bytes requested. <-- ioActCountLongIntThe number of bytes actually written. --> ioPosModeIntegerThe positioning mode. <-> ioPosOffsetLongIntThe positioning offset. DESCRIPTION
ThePBWritefunction takesioReqCountbytes from the buffer pointed to byioBufferand attempts to write them to the open file whose access path is specified byioRefNum. The position of the mark is specified byioPosModeandioPosOffset. If the write operation completes successfully,PBWritemoves the file mark to the byte following the last byte written and returnsnoErr. After the write operation is completed, the mark is returned inioPosOffsetand the number of bytes actually written is returned inioActCount.If you try to write past the logical end-of-file,
PBWritemoves the logical end-of-file. If you try to write past the physical end-of-file,PBWriteadds one or more clumps to the file and moves the physical end-of-file accordingly.ASSEMBLY-LANGUAGE INFORMATION
The trap macro forPBWriteis_Write.RESULT CODES