Linux
swqszjx
这个作者很懒,什么都没留下…
展开
-
Linux文件编程之光标移动
Linux文件编程之光标移动光标移动#include <sys/types.h>#include <unistd.h> //需要包含的头文件off_t lseek(int fd,off_t offset,int whence); //函数原型/*函数返回值是光标移动的偏移量fd:文件描述符offset:光标的偏移量,为正数时向后移动,为负数时前后移动whence:光标的位置 参数有:SEEK_SET:文件头、SEEK_END:文件尾、SEEK_CUR:当前位原创 2020-09-18 10:58:14 · 350 阅读 · 0 评论 -
Linux文件编程
Linux文件编程Linux文件编程主要分为以下几个步骤:打开/创建文件#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h> //需要包含的头文件int open (const char *pathname,int flags);int open (const char *pathname,int flags,mode_t mode);int creat (const char *pa原创 2020-09-17 21:01:40 · 74 阅读 · 0 评论