【发布时间】:2017-06-19 20:52:55
【问题描述】:
我正在为 Apache Server 开发一个模块。在那,我正在尝试使用 stat(const char *filename, struct stat *buf) 函数从路径 /tmp/_clusterMemberName/ 读取文件。我的问题是 stat() 函数返回 -1 即使路径上存在文件。如果我将文件位置从 /tmp/_clusterMemberName/ 更改为 /opt/ 则 stat() 函数工作正常。请帮我找出原因。
【问题讨论】:
-
调用 stat() 后,找出 errno 的值,看看它是否符合 stat 手册页中的一种情况。
标签: stat