access函数使用
来源:互联网 发布:未来世界网络黄金 编辑:程序博客网 时间:2024/04/28 21:41
access
This POSIX function is deprecated beginning in Visual C++ 2005. Use the ISO C++ conformant _access or security-enhanced _access_s instead.
Determines if a file is read-only or not. More secure versions are available; see _access_s, _waccess_s.
int _access(
const char *path,
int mode
);
int _waccess(
const wchar_t *path,
int mode
);
Parameters
path File or directory path.
mode Read/write attribute.
Return Value
Each function returns 0 if the file has the given mode. The function returns –1 if the named file does not exist or does not have the given mode; in this case, errno is set as shown in the following table.
EACCES Access denied: the file's permission setting does not allow specified access.
ENOENT File name or path not found.
EINVAL Invalid parameter.
For more information about these and other return codes, see _doserrno, errno, _sys_errlist, and _sys_nerr.
Remarks
When used with files, the _access function determines whether the specified file or directory exists and has the attributes specified by the value of mode. When used with directories, _access determines only whether the specified directory exists; in Windows 2000 and later operating systems, all directories have read and write access.
mode value Checks file for
00 Existence only
02 Write-only
04 Read-only
06 Read and write
This function only checks whether the file and directory are read-only or not, it does not check the filesystem security settings. For that you need an access token. For more information on filesystem security, see Access Tokens. An ATL class exists to provide this functionality; see CAccessToken Class.
_waccess is a wide-character version of _access; the path argument to _waccess is a wide-character string. _waccess and _access behave identically otherwise.
This function validates its parameters. If path is NULL or mode does not specify a valid mode, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, the function sets errno to EINVAL and returns -1.
- access函数使用
- access函数使用
- access函数使用
- access函数的使用
- Linux access()函数 使用
- Linux access()函数 使用
- Linux access()函数使用
- access中datepart函数使用
- access时间函数的使用
- access中使用自己编写的函数
- linux下access函数的使用
- C语言中access函数的使用
- access函数
- access函数
- access函数
- access函数
- access函数
- access函数
- hdu 4004 The Frog's Games
- 程序员的未来在哪里?
- android 资源
- 禁用 CTRL+ALT+DEL
- 绝对路径和相对路径
- access函数使用
- get field slot from row 0 col -1 failed
- LayoutInflater的使用 和 Context类中的常量
- jquery ajax 无法下载文件
- java jfreechart报表,饼形图,用swing画
- cocos2d-x 创建帧动画
- 视觉代码和软件
- DuLinkList
- Java内部类