Important: The information in this document is obsolete and should not be used for new development.
FSWrite
You can use theFSWrite
function to write any number of bytes to an open file.
FUNCTION FSWrite (refNum: Integer; VAR count: LongInt; buffPtr: Ptr): OSErr;
refNum
- The file reference number of an open file.
count
- On input, the number of bytes to write to the file; on output, the number of bytes actually written.
buffPtr
- A pointer to the data buffer from which the bytes are to be written.
DESCRIPTION
TheFSWrite
function takes the specified number of bytes from the specified data buffer and attempts to write them to the specified file. Because the write operation begins at
the current mark, you might want to set the mark first by calling theSetFPos
function.If the write operation completes successfully,
FSWrite
moves the file mark to the
byte following the last byte written and returnsnoErr
. If you try to write past the
logical end-of-file,FSWrite
moves the logical end-of-file. If you try to write past
the physical end-of-file,FSWrite
adds one or more clumps to the file and moves the physical end-of-file accordingly.
- Note
- The low-level
PBWrite
function lets you set the mark without having to callSetFPos
.RESULT CODES