MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / unixModeToPermissions

Function unixModeToPermissions

launcher/UpdateController.cpp:31–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29#define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */
30#endif
31static QFile::Permissions unixModeToPermissions(const int mode)
32{
33 QFile::Permissions perms;
34
35 if (mode & S_IRUSR)
36 {
37 perms |= QFile::ReadUser;
38 }
39 if (mode & S_IWUSR)
40 {
41 perms |= QFile::WriteUser;
42 }
43 if (mode & S_IXUSR)
44 {
45 perms |= QFile::ExeUser;
46 }
47
48 if (mode & S_IRGRP)
49 {
50 perms |= QFile::ReadGroup;
51 }
52 if (mode & S_IWGRP)
53 {
54 perms |= QFile::WriteGroup;
55 }
56 if (mode & S_IXGRP)
57 {
58 perms |= QFile::ExeGroup;
59 }
60
61 if (mode & S_IROTH)
62 {
63 perms |= QFile::ReadOther;
64 }
65 if (mode & S_IWOTH)
66 {
67 perms |= QFile::WriteOther;
68 }
69 if (mode & S_IXOTH)
70 {
71 perms |= QFile::ExeOther;
72 }
73 return perms;
74}
75
76static const QLatin1String liveCheckFile("live.check");
77

Callers 1

installUpdatesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected