https://www.cnblogs.com/starrys/p/12008562.html
https://blog.csdn.net/Edward_Asia/article/details/124494079
目录
文件打开与关闭
https://blog.csdn.net/weixin_68278653/article/details/130836626
读写
一、二进制文件
二、文本文件
- fgets
https://blog.csdn.net/Devour_/article/details/110955333
https://www.cnblogs.com/L-0x0b/p/10858518.html
回车与换行符:https://blog.csdn.net/wangsh217/article/details/11031089/
目录操作
https://blog.csdn.net/qq_64928278/article/details/131945858
其它
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <stdio.h>
//创建目录名(先判断存不存在)
int file_exist(const char* path){
DIR *dp;
if ((dp = opendir(path)) == NULL){
mkdir(path, S_IRWXU);
//printf("path = %s\n", path);
return 0;
}
else{
closedir(dp);
return 1;
}
}
int main(int argc, char* argv[]){
file_exist(argv[1]);
return 0;
}
-
改变工作目录(chdir)
https://blog.csdn.net/leimeili/article/details/133339927 -
目录遍历
https://blog.csdn.net/fuhanghang/article/details/132446193 -
删除目录rmdir
fd操作
-
获取目录的fd值 (dirfd)
https://www.cnblogs.com/hulubaby/p/9382583.html -
通过fd获取目录(fchdir)
https://www.jb51.net/article/71811.htm
0 条评论