2017年1月22日
摘要: 设置工作目录: #include <unistd.h> int chdir(const char *path); int fchdir(int fd); chdir() changes the current working directory of the calling process to t 阅读全文
posted @ 2017-01-22 15:21 邶风 阅读(1099) 评论(0) 推荐(0) 编辑
摘要: #include <sys/stat.h> #include <sys/types.h> int mkdir(const char *pathname, mode_t mode); 创建一个新的空目录,空目录中会自动创建 . 和.. 目录 所创建的目录的存取权限由 mode&~umask 指定 #i 阅读全文
posted @ 2017-01-22 14:17 邶风 阅读(306) 评论(0) 推荐(0) 编辑
摘要: int rename(const char *oldpath, const char *newpath); rename() renames a file, moving it between directories if required. 利用rename实现简单的mv指令 文件的删除可以使用u 阅读全文
posted @ 2017-01-22 14:02 邶风 阅读(2058) 评论(0) 推荐(0) 编辑
摘要: #include <sys/types.h> #include <sys/stat.h> mode_t umask(mode_t mask); 在进程创建一个新的文件或目录时,如调用open函数创建一个新文件,新文件的实际存取权限是mode与umask按照 mode&~umask运算以后的结果。um 阅读全文
posted @ 2017-01-22 10:29 邶风 阅读(2459) 评论(0) 推荐(0) 编辑