1.open,create,write,close,lseek。fcntl.h、unistd.h中
等无缓冲IO函数,打开的文件是在内核中用int类型的文件描述符来标识由open系统调用获得,write,close,lseek等系统调用要用到文件描述符。
其中惯例是0为标准输入STDIN_FILENO,1为标准输出STDOUT_FILENO,2为标准错误STDERR_FILENO.
格式如下:
a.int open(const char *pathname,int oflag,..../mode_t mode/);返回文件描述符
b.int close(int filedes);filedes为文件描述符。
c.off_t lseek(int filedes,off_t offset,int whence)可根据whence的不同来判断从哪里开始偏移。返回偏移量