3 #include <msvcrt/errno.h>
5 #include <msvcrt/msvcrtdbg.h>
23 int _access( const char *_path
, int _amode
)
25 DWORD Attributes
= GetFileAttributesA(_path
);
26 DPRINT("_access('%s', %x)\n", _path
, _amode
);
28 if ( Attributes
== -1 ) {
33 if ( (_amode
& W_OK
) == W_OK
) {
34 if ( (Attributes
& FILE_ATTRIBUTE_READONLY
) == FILE_ATTRIBUTE_READONLY
) {
39 if ( (_amode
& D_OK
) == D_OK
) {
40 if ( (Attributes
& FILE_ATTRIBUTE_DIRECTORY
) != FILE_ATTRIBUTE_DIRECTORY
) {
49 int _waccess( const wchar_t *_path
, int _amode
)
51 DWORD Attributes
= GetFileAttributesW(_path
);
53 if ( Attributes
== -1 ) {
58 if ( (_amode
& W_OK
) == W_OK
) {
59 if ( (Attributes
& FILE_ATTRIBUTE_READONLY
) == FILE_ATTRIBUTE_READONLY
) {
64 if ( (_amode
& D_OK
) == D_OK
) {
65 if ( (Attributes
& FILE_ATTRIBUTE_DIRECTORY
) != FILE_ATTRIBUTE_DIRECTORY
) {