2023年9月12日

linux 目录操作函数 mkdir rename chdir

摘要: mkdir 1 /* 2 man 2 mkdir:linux系统函数 3 #include <sys/stat.h> 4 #include <sys/types.h> 5 int mkdir(const char* pathname, mode_t mode); 6 作用:创建一个目录 7 参数: 阅读全文

posted @ 2023-09-12 16:56 廿陆 阅读(69) 评论(0) 推荐(0)

linux 文件属性操作函数 access chmod truncate

摘要: access:判断某个文件是否有某个权限,或者某个权限是否存在 1 /* 2 #include <unistd.h> 3 int access(const char* pahtname, int mode); 4 作用:判断某个文件是否有某个权限,或者某个权限是否存在 5 参数: 6 - pathn 阅读全文

posted @ 2023-09-12 15:32 廿陆 阅读(20) 评论(0) 推荐(0)

linux案例 模拟 ls -l

摘要: ls -l //当前目录下文件的信息 文件权限 硬链接数 所有者 所在组 大小 最后修改时间 文件名称 ls -l 文件名称 //具体文件的信息 1 #include <stdio.h> 2 #include <sys/types.h> //stat 3 #include <sys/stat.h> 阅读全文

posted @ 2023-09-12 11:39 廿陆 阅读(15) 评论(0) 推荐(0)

Linxu系统IO函数 stat 和 lstat 函数

摘要: stat 和 lstat函数 作用:获取一个文件相关的一些信息 st_mode 1 /* 2 stat: man 2 stat 3 #include <sys/types.h> 4 #include <sys/stat.h> 5 #include <unistd.h> 6 7 int stat(co 阅读全文

posted @ 2023-09-12 10:56 廿陆 阅读(47) 评论(0) 推荐(0)

导航