Important: The information in this document is obsolete and should not be used for new development.
PBWrite
You can use thePBWrite
function 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.
--> ioCompletion
ProcPtr
A pointer to a completion routine. <-- ioResult
OSErr
The result code of the function. --> ioRefNum
Integer
A file reference number. --> ioBuffer
Ptr
A pointer to a data buffer. --> ioReqCount
LongInt
The number of bytes requested. <-- ioActCount
LongInt
The number of bytes actually written. --> ioPosMode
Integer
The positioning mode. <-> ioPosOffset
LongInt
The positioning offset. DESCRIPTION
ThePBWrite
function takesioReqCount
bytes from the buffer pointed to byioBuffer
and attempts to write them to the open file whose access path is specified byioRefNum
. The position of the mark is specified byioPosMode
andioPosOffset
. If the write operation completes successfully,PBWrite
moves the file mark to the byte following the last byte written and returnsnoErr
. After the write operation is completed, the mark is returned inioPosOffset
and the number of bytes actually written is returned inioActCount
.If you try to write past the logical end-of-file,
PBWrite
moves the logical end-of-file. If you try to write past the physical end-of-file,PBWrite
adds one or more clumps to the file and moves the physical end-of-file accordingly.ASSEMBLY-LANGUAGE INFORMATION
The trap macro forPBWrite
is_Write
.RESULT CODES