我正在对 Apache Portable Runtime 库(1.4 版)进行以下调用:
result = apr_file_open(
&file, // new file handle
pathname, // file name
APR_FOPEN_CREATE | // create file if not there
APR_FOPEN_EXCL | // error if file was there already
APR_FOPEN_APPEND | // move to end of file on open
APR_FOPEN_BINARY | // binary mode (ignored on UNIX)
APR_FOPEN_XTHREAD | // allow multiple threads to use file
0, // flags
APR_OS_DEFAULT |
0, // permissions
pool // memory pool to use
);
if ( APR_SUCCESS != result ) {
fprintf(
stderr,
"could not create file \"%s\": %s",
pathname,
apr_errorstr( result )
);
}
并pathname
包含字符串/tmp/tempfile20110614091201
。
我不断收到错误“权限被拒绝”(结果代码APR_EACCES
),但我有权读取/写入/tmp
- 可能导致这种情况的原因是什么?