摘要:
lseek文件在打开时读写位置是0,如果是以O_APPEND方式打开,位置会移致动到文件末尾#include #include /*移动当前读写位置 参数同fseek offset 偏移量 whence 起始位置*/off_t lseek(int fd,off_t offset,int whence);打开文件的当前偏移量off_t currpos;currpos=lseek(fd,0,SEEK_CUR);fcntl改变一个已打开的文件的属性,可以重新设置读、写、追加、非阻塞标志(file statusflag)#include #include int fcntl(int fd,int cm 阅读全文