"Juan Lang" juan_lang@yahoo.com wrote:
- buf->st_mode = S_IFREG;
- if (!(hfi.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)))
- {
- buf->st_mode |= S_IREAD;
- if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
buf->st_mode |= S_IWRITE;
- }
Why do you take into account (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM) at all? They have nothing to do with an ability to read/write files. What you probably need to consider is a type of a file passed in.