Important: The information in this document is obsolete and should not be used for new development.
FSRead
You can use theFSRead
function to read any number of bytes from an open file.
FUNCTION FSRead (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 read; on output, the number of bytes actually read.
buffPtr
- A pointer to the data buffer into which the bytes are to be read.
DESCRIPTION
TheFSRead
function attempts to read the requested number of bytes from the specified file into the specified buffer. ThebuffPtr
parameter points to that buffer; this buffer is allocated by your application and must be at least as large as thecount
parameter.Because the read operation begins at the current mark, you might want to set the mark first by calling the
SetFPos
function. If you try to read past the logical end-of-file,FSRead
reads in all the data up to the end-of-file, moves the mark to the end-of-file, and returnseofErr
as its function result. Otherwise,FSRead
moves the file mark to the byte following the last byte read and returnsnoErr
.RESULT CODES