ac
来自「Algorithms for Image Processing and Comp」· 代码 · 共 51 行
TXT
51 行
@c ----------------------------------------------------------------------
@node access, file system
@heading @code{access}
@subheading Syntax
@example
#include <unistd.h>
int access(const char *filename, int flags);
@end example
@subheading Description
This function determines what kind of access modes a given file allows.
The parameter @var{flags} is the logical @code{or} of one or more of the
following flags:
@table @code
@item R_OK
Request if the file is readable. Since all files are readable under
MS-DOS, this access mode always exists.
@item W_OK
Request if the file is writable.
@item X_OK
Request if the file is executable. This flag currently has no affect.
@item F_OK
Request if the file exists.
@end table
@subheading Return Value
Zero if the requested access mode is allowed, nonzero if not.
@subheading Example
@example
if (access("file.ext", W_OK))
return ERROR_CANNOT_WRITE;
open("file.ext", O_RDWR);
@end example
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?