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

Function SetFileAttr

Libraries/unrar/filefn.cpp:302–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300
301
302bool 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

Callers 10

ExtractUnixOwner20Function · 0.85
ExtractUnixOwner30Function · 0.85
CreateReparsePointFunction · 0.85
MakeDirFunction · 0.85
SetDirTimeFunction · 0.85
PrepareToDeleteFunction · 0.85
ExtractStreams20Function · 0.85
ExtractStreamsFunction · 0.85
ExtractCurrentFileMethod · 0.85
ExtrCreateDirMethod · 0.85

Calls 2

GetWinLongPathFunction · 0.85
WideToCharFunction · 0.85

Tested by

no test coverage detected