_Rfeov ()- 强制结束文件
格式
#include <recio.h>
int _Rfeov(_RFILE *fp);语言级别
ILE C 扩展
线程安全
是
描述
_Rfeov() 函数对与 fp指定的文件关联的磁带文件强制实施卷结束条件。 _Rfeov() 函数将文件定位到文件的下一个卷。 如果打开该文件以进行输出,那么将清空输出缓冲区。
_Rfeov() 函数对磁带文件有效。
返回值
示例
#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 );
}