Format
#include <recio.h>
int _Rfeod(_RFILE *fp);
Language Level: ILE C Extension
Threadsafe: Yes.
Description
The _Rfeod() function forces an end-of-data condition for a device or member associated with the file specified by fp. Any outstanding updates, deletes or writes that the system is buffering will be forced to nonvolatile storage. If a database file is open for input, any outstanding locks will be released.
The _Rfeod() function positions the file to *END unless the file is open for multi-member processing and the current member is not the last member in the file. If multi-member processing is in effect and the current member is not the last member in the file, _Rfeod() will open the next member of the file and position it to *START.
The _Rfeod() function is valid for all types of files.
Return Value
The _Rfeod() function returns 1 if multi-member processing is taking place and the next member has been opened. EOF is returned if the file is positioned to *END. If the operation is unsuccessful, zero is returned. The value of errno may be set to EIOERROR (a non-recoverable error occurred) or EIORECERR (a recoverable I/O error occurred). See Table 12 and Table 14 for errno settings.
Example that uses _Rfeod()
#include <stdio.h>
#include <stdlib.h>
#include <recio.h>
int main(void)
{
_RFILE *in;
char new_purchase[21] = "PEAR 1002022244";
/* Open the file for processing in keyed sequence. */
if ( (in = _Ropen("MYLIB/T1677RD4", "rr+, arrseq=N")) == NULL )
{
printf("Open failed\n");
exit(1);
};
/* Update the first record in the keyed sequence. */
_Rlocate(in, NULL, 0, __FIRST);
_Rupdate(in, new_purchase, 20);
/* Force the end of data. */
_Rfeod(in);
Related Information