MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / GetFileAttr

Function GetFileAttr

Libraries/unrar/filefn.cpp:280–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278
279
280uint 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
302bool SetFileAttr(const wchar *Name,uint Attr)

Callers 6

ProcessCommandMethod · 0.85
ExtractUnixOwner20Function · 0.85
ExtractUnixOwner30Function · 0.85
SetDirTimeFunction · 0.85
FileExistFunction · 0.85
ExtrCreateDirMethod · 0.85

Calls 3

GetWinLongPathFunction · 0.85
WideToCharFunction · 0.85
statClass · 0.70

Tested by

no test coverage detected