Important: The information in this document is obsolete and should not be used for new development.
FSWrite
You can use theFSWritefunction 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
TheFSWritefunction 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 theSetFPosfunction.If the write operation completes successfully,
FSWritemoves the file mark to the
byte following the last byte written and returnsnoErr. If you try to write past the
logical end-of-file,FSWritemoves the logical end-of-file. If you try to write past
the physical end-of-file,FSWriteadds one or more clumps to the file and moves the physical end-of-file accordingly.
- Note
- The low-level
PBWritefunction lets you set the mark without having to callSetFPos.![]()
RESULT CODES