| 278 | |
| 279 | |
| 280 | uint GetFileAttr(const wchar *Name) |
| 281 | { |
| 282 | #ifdef _WIN_ALL |
| 283 | DWORD Attr=GetFileAttributes(Name); |
| 284 | if (Attr==0xffffffff) |
| 285 | { |
| 286 | wchar LongName[NM]; |
| 287 | if (GetWinLongPath(Name,LongName,ASIZE(LongName))) |
| 288 | Attr=GetFileAttributes(LongName); |
| 289 | } |
| 290 | return Attr; |
| 291 | #else |
| 292 | char NameA[NM]; |
| 293 | WideToChar(Name,NameA,ASIZE(NameA)); |
| 294 | struct stat st; |
| 295 | if (stat(NameA,&st)!=0) |
| 296 | return 0; |
| 297 | return st.st_mode; |
| 298 | #endif |
| 299 | } |
| 300 | |
| 301 | |
| 302 | bool SetFileAttr(const wchar *Name,uint Attr) |
no test coverage detected