linux 函数
迷失的流氓兔
苦哈哈的码农
展开
-
文件操作API
个人笔记一:open函数 int open(const char *pathname, int flags); int open(const char *pathname, int flags, mode_t mode);参数说明:1:pathname:创建文件路径名。2:flags:O_RDONLY(只读)、O_WRONLY(只写...原创 2022-01-07 00:11:50 · 251 阅读 · 0 评论 -
linux access函数
函数原型 :int access(const char* pathname, int mode);参数介绍:pathname 是文件的路径名+文件名mode:指定access的作用,取值如下 F_OK 值为0,判断文件是否存在 X_OK 值为1,判断对文件是可执行权限 W_OK 值为2,判断对文件是否有写权限 R_OK 值为4,判断对文件是否有读权限 注:后三种可以使用或“|”的方式,一起使用,如W_OK|R_OK...原创 2021-04-04 16:24:27 · 98 阅读 · 0 评论