Rudiments
|
Static Public Member Functions | |
static bool | setFilePermissions (const char *filename, mode_t perms) |
static bool | setFilePermissions (int32_t fd, mode_t perms) |
static mode_t | parsePermString (const char *permstring) |
static char * | parsePermOctal (mode_t mode) |
static mode_t | getEveryoneReadWrite () |
static mode_t | getEveryoneReadWriteExecute () |
static mode_t | getOwnerRead () |
static mode_t | getOwnerWrite () |
static mode_t | getOwnerExecute () |
static mode_t | getOwnerReadWrite () |
static mode_t | getOwnerReadExecute () |
static mode_t | getOwnerReadWriteExecute () |
static mode_t | getGroupRead () |
static mode_t | getGroupWrite () |
static mode_t | getGroupExecute () |
static mode_t | getGroupReadWrite () |
static mode_t | getGroupReadExecute () |
static mode_t | getGroupReadWriteExecute () |
static mode_t | getOthersRead () |
static mode_t | getOthersWrite () |
static mode_t | getOthersExecute () |
static mode_t | getOthersReadWrite () |
static mode_t | getOthersReadExecute () |
static mode_t | getOthersReadWriteExecute () |
static mode_t | getSaveInSwapSpace () |
static mode_t | getSetUserId () |
static mode_t | getSetGroupId () |
Permissions are access priveleges. Files, directories, semaphores and shared memory segments all have permissions associated with them.
There are 3 types of permissions: read, write and execute.
These permissions can be granted to:
The execute permission has 2 modifications which can be applied to it:
The "sticky bit" may also be set on platforms that support it. When set, the file is saved in the system's swap space. As a side-effect, it cannot be deleted by a user other than the one that created it.
|
static |
Returns rw-rw-rw- (666) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns rwxrwxrwx (777) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns --—x— (010) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns —r--— (040) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns —r-x— (050) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns —rw-— (060) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns —rwx— (070) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns -—w-— (020) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns -----—x (001) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns ---—r– (004) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns ---—r-x (005) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns ---—rw- (006) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns ---—rwx (007) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns ----—w- (002) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns –x---— (100) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns r-----— (400) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns r-x---— (500) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns rw----— (600) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns rwx---— (700) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns -w----— (200) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns -----—t permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns --—s— (g+s) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
Returns –s---— (u+s) permissions.
May be or'ed together with the result of another method to define a permission.
|
static |
The inverse of parsePermString(). Evaluates "mode" and returns a string representing the permissions.
|
static |
Returns the permission defined in "permstring".
"permstring" should be the same format as displayed by the "ls -l" command.
The first 3 characters set permissions for the owner. The next 3 characters set permissions for the group. The next 3 characters set permissions for all others.
For example: rwxr-xr-x : read/execute for everyone and write for the owner rw-rw-r– : read for everyone and write for the owner and owner's group rw-r–r– : read for everyone and write for the owner rwsr-sr-x : read/execute for everyone, write for the owner and run as the user/group that owns the file rw-rw-rwt : read/write for everyone, and save the file in swap space
|
static |
Set the permissions on "filename" to "perms".
Returns true on success and false on failure.
|
static |
Set the permissions on the file associated with file descriptor "fd" to "perms".
Returns true on success and false on failure.