io分类

文件 IO

 

 

在文件IO 中是通过文件描述符操作文件的,实际上是一个非负整数

文件 IO

 

头文件   #include <sys/types.h>   #include <fcntl.h>

 int open(const char *pathname, int flags);     打开文件
 int open(const char *pathname, int flags, mode_t mode);     打开文件

 int close(int fd);   关闭文件

 文件 IO    文件 IO

 

头文件    #include <unistd.h>

ssize_t read(int fd, void *buf, size_t count);   读取文件内容

ssize_t write(int fd, const void *buf, size_t count);    向文件写入内容

off_t lseek(int fd, off_t offset, int whence);    设置文件的偏移

文件 IO 文件 IO 文件 IO

 

相关文章:

  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-08-20
  • 2021-07-28
  • 2021-08-05
  • 2021-06-21
猜你喜欢
  • 2021-11-04
  • 2022-02-28
  • 2021-11-23
  • 2021-09-20
  • 2021-07-15
相关资源
相似解决方案