Important: The information in this document is obsolete and should not be used for new development.
ReadEdition
Use theReadEdition
function to read data from an edition. This function reads from the current mark for the specified format.
FUNCTION ReadEdition (whichEdition: EditionRefNum; whichFormat: FormatType; buffPtr: UNIV Ptr; VAR buffLen: Size): OSErr;
whichEdition
- The reference number for the edition.
whichFormat
- The format type that you want to read.
buffPtr
- A pointer to the buffer into which you want to read the data.
buffLen
- The number of bytes that you want to read into the buffer. The
ReadEdition
function returns the actual number of bytes read in thebuffLen
parameter.DESCRIPTION
TheReadEdition
function reads data from the edition into the specified buffer.ReadEdition
returns in thebuffLen
parameter the total number of bytes read into the buffer. If thebuffLen
parameter returns a value smaller than the value you have specified, there is no additional data to read, and theReadEdition
function returns anoErr
result code. If you use theReadEdition
function after all data is read in, theReadEdition
function returns aneofErr
result code.You can read data from an edition while a publisher on the same machine is writing data to the same edition. The data that you are reading is the old edition (not the data that the publisher is writing). If the publisher finishes writing data before you are through reading the old edition data, the
ReadEdition
function returns anabortErr
result code. If theReadEdition
function returns anabortErr
result code, you should stop trying to read data and use theCloseEdition
function with thesuccessful
parameter set toFALSE
.
- Note
- The Translation Manager (if it is available) attempts implicit translation under certain circumstances. For instance, it does so when your application attempts to read from an edition a format type that is not in the edition. In this case, the Translation Manager attempts to translate the data into the requested format. For more information, see the chapter "Translation Manager" in Inside Macintosh: More Macintosh Toolbox.
RESULT CODES
noErr 0 No error abortErr -27 Publisher has written a new edition ioErr -36 I/O error fnOpnErr -38 File not open eofErr -39 No more data of that format rfNumErr -51 Bad edition reference number noTypeErr -102 Format not available editionMgrInitErr -450 Manager not initialized SEE ALSO
For an example of the use ofReadEdition
, see Listing 2-7 beginning on page 2-42.