aihot  2020-11-12 11:19:17  OpenCV |   查看评论   

下面这个函数将从文件的任意位置读取任意数目的字节数,返回读入的字节数,若错误则返回-1

#include "syscalls.h"  /*get函数:从pos位置处读入n个字节*/ int get(int fd,long pos,char *buf,int n) {     if((lseek(fd,pos,0))>0)         return read(fd,buf,n);     else         return -1; }
 

除特别注明外,本站所有文章均为 赢咖4注册 原创,转载请注明出处来自《TCPL》 第8章 Unix系统接口

留言与评论(共有 0 条评论)
   
验证码:
[lianlun]1[/lianlun]