Module grp
[hide private]
[frames] | no frames]

Module grp

Access to the Unix group database.

Group entries are reported as 4-tuples containing the following fields
from the group database, in order:

  name   - name of the group
  passwd - group password (encrypted); often empty
  gid    - numeric ID of the group
  mem    - list of members

The gid is an integer, name and password are strings.  (Note that most
users are not explicitly listed as members of the groups they are in
according to the password database.  Check both databases to get
complete membership information.)

Classes [hide private]
struct_group
grp.struct_group: Results from getgr*() routines.
Functions [hide private]
list of tuples
getgrall()
Return a list of all available group entries, in arbitrary order.
tuple
getgrgid(id)
Return the group database entry for the given numeric group ID.
tuple
getgrnam(name)
Return the group database entry for the given group name.
Function Details [hide private]

getgrgid(id)

 

Return the group database entry for the given numeric group ID. If id is not valid, raise KeyError.

Returns: tuple

getgrnam(name)

 

Return the group database entry for the given group name. If name is not valid, raise KeyError.

Returns: tuple