_Rfeov() — Force the End-of-File
Format
#include <recio.h>
int _Rfeov(_RFILE *fp);
Language Level
ILE C Extension
Threadsafe
Yes
Description
The _Rfeov()
function
forces an end-of-volume condition for a tape file that is associated
with the file that is specified by fp. The _Rfeov()
function
positions the file to the next volume of the file. If the file is
open for output, the output buffers will be flushed.
The _Rfeov()
function
is valid for tape files.
Return Value
The
_Rfeov()
function
returns 1 if the file has moved from one volume to the next. It will
return EOF if it is called while processing the last volume of the
file. It will return zero if the operation is unsuccessful. The value
of errno may be set to EIOERROR (a non-recoverable error occurred)
or EIORECERR (a recoverable I/O error occurred). See Table 1 and Table 1 for
errno settings.Example
#include <stdio.h>
#include <recio.h>
#include <stdlib.h>
int main(void)
{
_RFILE *tape;
_RFILE *fp;
char buf[92];
int i, feov2;
/* Open source physical file containing C source. */
if (( fp = _Ropen ( "QCSRC(T1677SRC)", "rr blkrcd=y" )) == NULL )
{
printf ( "could not open C source file\n" );
exit ( 1 );
}
/* Open tape file to receive C source statements */
if (( tape = _Ropen ( "T1677TPF", "wr lrecl=92 blkrcd=y" )) == NULL )
{
printf ( "could not open tape file\n" );
exit ( 2 );
}
/* Read the C source statements, find their sizes */
/* and add them to the tape file. */
while (( _Rreadn ( fp, buf, sizeof(buf), __DFT )) -> num_bytes != EOF
)
{
for ( i = sizeof(buf) - 1 ; buf[i] == ' ' && i > 12; --i );
i = (i == 12) ? 80 : (1-12);
memmove( buf, buf+12, i );
_Rwrite ( tape, buf, i );
}
feov2 = _Rfeov (fp);
_Rclose ( fp );
_Rclose ( tape );
}