编写一个程序,用于测试标准输入文件是否能使用lseek函数来设置位移量
/*
编写一个程序,用于测试标准输入文件是否能使用lseek函数来设置位移量*/
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if(lseek(0,0,SEEK_CUR)==-1)//判断标准输入文件能否设置位移量
printf("cannot seek!\n");
else
printf("seek OK!\n");
return 0;
}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。