4 /* common Win32 functions for MinGW and Cygwin */
5 #ifndef GIT_WINDOWS_NATIVE /* Not defined for Cygwin */
9 static inline int file_attr_to_st_mode (DWORD attr
)
12 if (attr
& FILE_ATTRIBUTE_DIRECTORY
)
16 if (!(attr
& FILE_ATTRIBUTE_READONLY
))
21 static inline int get_file_attr(const char *fname
, WIN32_FILE_ATTRIBUTE_DATA
*fdata
)
23 if (GetFileAttributesExA(fname
, GetFileExInfoStandard
, fdata
))
26 switch (GetLastError()) {
27 case ERROR_ACCESS_DENIED
:
28 case ERROR_SHARING_VIOLATION
:
29 case ERROR_LOCK_VIOLATION
:
30 case ERROR_SHARING_BUFFER_EXCEEDED
:
32 case ERROR_BUFFER_OVERFLOW
:
34 case ERROR_NOT_ENOUGH_MEMORY
: