4 /* common Win32 functions for MinGW and Cygwin */
7 static inline int file_attr_to_st_mode (DWORD attr
)
10 if (attr
& FILE_ATTRIBUTE_DIRECTORY
)
14 if (!(attr
& FILE_ATTRIBUTE_READONLY
))
19 static inline int get_file_attr(const char *fname
, WIN32_FILE_ATTRIBUTE_DATA
*fdata
)
21 if (GetFileAttributesExA(fname
, GetFileExInfoStandard
, fdata
))
24 switch (GetLastError()) {
25 case ERROR_ACCESS_DENIED
:
26 case ERROR_SHARING_VIOLATION
:
27 case ERROR_LOCK_VIOLATION
:
28 case ERROR_SHARING_BUFFER_EXCEEDED
:
30 case ERROR_BUFFER_OVERFLOW
:
32 case ERROR_NOT_ENOUGH_MEMORY
: