all Python 3Linux · macOSosfunction
os.getegid
os — user/group IDs
Return the process's effective group id. Availability: Unix.
Syntax
os.getegid(...)
The effective GID takes part in permission checks together with supplementary groups. For a setgid program it equals the group of the program file. Files the process creates usually get it as their group, unless the directory has the setgid bit.
Examples
import os
print(os.getegid()) # → ? только Unix: эффективный GID процесса, например 1000
print(type(os.getegid())) # → ? только Unix: <class 'int'>
print(os.getegid() == os.getgid()) # → ? только Unix: True, пока setgid-бит не сменил группу процесса
print(os.getegid() == 0) # → ? только Unix: True, если права процесса выданы по группе root
See also
Open in the full glossarydocs.python.orgReport an inaccuracy