Rudiments
|
00001 // Copyright (c) 1999-2002 David Muse 00002 // See the COPYING file for more information. 00003 00004 #ifndef RUDIMENTS_PERMISSIONS_H 00005 #define RUDIMENTS_PERMISSIONS_H 00006 00007 #include <rudiments/private/permissionsincludes.h> 00008 00009 #ifdef RUDIMENTS_NAMESPACE 00010 namespace rudiments { 00011 #endif 00012 00032 class RUDIMENTS_DLLSPEC permissions { 00033 public: 00037 static bool setFilePermissions(const char *filename, 00038 mode_t perms); 00039 00044 static bool setFilePermissions(int32_t fd, mode_t perms); 00045 00073 static mode_t evalPermString(const char *permstring); 00074 00076 static char *evalPermOctal(mode_t mode); 00077 00082 static mode_t everyoneReadWrite(); 00083 00088 static mode_t everyoneReadWriteExecute(); 00089 00094 static mode_t ownerRead(); 00095 00100 static mode_t ownerWrite(); 00101 00106 static mode_t ownerExecute(); 00107 00112 static mode_t ownerReadWrite(); 00113 00118 static mode_t ownerReadExecute(); 00119 00124 static mode_t ownerReadWriteExecute(); 00125 00130 static mode_t groupRead(); 00131 00136 static mode_t groupWrite(); 00137 00142 static mode_t groupExecute(); 00143 00148 static mode_t groupReadWrite(); 00149 00154 static mode_t groupReadExecute(); 00155 00160 static mode_t groupReadWriteExecute(); 00161 00166 static mode_t othersRead(); 00167 00172 static mode_t othersWrite(); 00173 00178 static mode_t othersExecute(); 00179 00184 static mode_t othersReadWrite(); 00185 00190 static mode_t othersReadExecute(); 00191 00196 static mode_t othersReadWriteExecute(); 00197 00202 static mode_t saveInSwapSpace(); 00203 00208 static mode_t setUserId(); 00209 00214 static mode_t setGroupId(); 00215 }; 00216 00217 #ifdef RUDIMENTS_NAMESPACE 00218 } 00219 #endif 00220 00221 #endif