1 /* common Win32 functions for MinGW and Cygwin */
4 static inline int file_attr_to_st_mode (DWORD attr)
7 if (attr & FILE_ATTRIBUTE_DIRECTORY)
11 if (!(attr & FILE_ATTRIBUTE_READONLY))
16 static inline int get_file_attr(const char *fname, WIN32_FILE_ATTRIBUTE_DATA *fdata)
18 if (GetFileAttributesExA(fname, GetFileExInfoStandard, fdata))
21 switch (GetLastError()) {
22 case ERROR_ACCESS_DENIED:
23 case ERROR_SHARING_VIOLATION:
24 case ERROR_LOCK_VIOLATION:
25 case ERROR_SHARING_BUFFER_EXCEEDED:
27 case ERROR_BUFFER_OVERFLOW:
29 case ERROR_NOT_ENOUGH_MEMORY: