关于linux下的access函数的疑问?
- C/C++ code
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <errno.h>#include <string.h>int main(){ char *filename="/home/test/测试.jpg"; if(access(filename, F_OK) == -1) printf("sorry, %s\n", strerror(errno)); else printf("ok\n"); return 0;}代码如上,在 /home/test 目录下确实存在 测试.jpg 文件,access函数有可能会通过么,即输出 OK。在什么样的情况下会通过?