| 300 | |
| 301 | |
| 302 | bool SetFileAttr(const wchar *Name,uint Attr) |
| 303 | { |
| 304 | #ifdef _WIN_ALL |
| 305 | bool Success=SetFileAttributes(Name,Attr)!=0; |
| 306 | if (!Success) |
| 307 | { |
| 308 | wchar LongName[NM]; |
| 309 | if (GetWinLongPath(Name,LongName,ASIZE(LongName))) |
| 310 | Success=SetFileAttributes(LongName,Attr)!=0; |
| 311 | } |
| 312 | return Success; |
| 313 | #elif defined(_UNIX) |
| 314 | char NameA[NM]; |
| 315 | WideToChar(Name,NameA,ASIZE(NameA)); |
| 316 | return chmod(NameA,(mode_t)Attr)==0; |
| 317 | #else |
| 318 | return false; |
| 319 | #endif |
| 320 | } |
| 321 | |
| 322 | |
| 323 | #if 0 |
no test coverage detected