A tiny wrapper to get information about file permissions
Permissions provides a tiny wrapper on top of built-in Python's libraries
to get information about file permissions in Unix systems.
Currently everything related to permission management is spreaded across few packages.
It is nice and handy to have everything gathered together.
Permissions is quite incomplete
at the moment and any kind of missed functionality is welcome as pull requests or GitHub issues.
pip install file-permissions
from permissions import get_permissions_from p = get_permissions_from('test.txt') # returns PermissionsContainer object p.executable() # False p.readable() # True
Available fields in PermissionsContainer:
- executable - boolean, indicates whether file could be executed by current user or not;
- group - object(pwd.struct_group), contains information about group the file belongs to. Available fields there are:
- is_sticky - boolean, inficates whether file has sticky bit or not.
- owner - object(pwd.struct_passwd), contains information about user the file belongs to. Available fields there are:
- readable - boolean, indicates whether file could be read by current user or not;
- sgid - returns SGID if set or 0;
- suid - returns SUID if set or 0;
- umask - str, file permissions as umask, e. g. 0755, 0400;
- writable - boolean, indicates whether file could be written by current user or not;
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size file_permissions-0.2-py2-none-any.whl (2.6 kB)||File type Wheel||Python version py2||Upload date||Hashes View hashes|
Hashes for file_permissions-0.2-py2-none-any.whl