Linux Unix C 文件目录的操作

发布时间:2020-03-06 09:14:37 作者:old_fox
来源:网络 阅读:397

1需要包含的头文件:

#include<dirent.h>

#include<unistd.h>

#include<fcntl.h>

#include<sys/types.h>

#include<sys/stat.h>


2常用函数:

int mkdir(const char *path,mode_t mode); 创建一个目录

DIR *opendir(const char*path);打开一个目录

struct dirent *readdir(DIR *dir);读取目录

void rewinddir(DIR *dir);

off_t telldir(DIR *dir); 返回读取目录的偏移量

void seekdir(DIR *dir,off_t off);

int closedir(DIR *dir);

推荐阅读:
  1. 回顾UNIX LINUX BSD架构
  2. linux基本文件目录的结构及管理

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

c/c++ un

上一篇:oracle 表字段类型,与业务SQL不合理,导致的隐式转换

下一篇:初识Linux,简单配置

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》