source: vendor/python/2.5/Doc/lib/libgrp.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 1.7 KB
Line 
1\section{\module{grp} ---
2 The group database}
3
4\declaremodule{builtin}{grp}
5 \platform{Unix}
6\modulesynopsis{The group database (\function{getgrnam()} and friends).}
7
8
9This module provides access to the \UNIX{} group database.
10It is available on all \UNIX{} versions.
11
12Group database entries are reported as a tuple-like object, whose
13attributes correspond to the members of the \code{group} structure
14(Attribute field below, see \code{<pwd.h>}):
15
16\begin{tableiii}{r|l|l}{textrm}{Index}{Attribute}{Meaning}
17 \lineiii{0}{gr_name}{the name of the group}
18 \lineiii{1}{gr_passwd}{the (encrypted) group password; often empty}
19 \lineiii{2}{gr_gid}{the numerical group ID}
20 \lineiii{3}{gr_mem}{all the group member's user names}
21\end{tableiii}
22
23The gid is an integer, name and password are strings, and the member
24list is a list of strings.
25(Note that most users are not explicitly listed as members of the
26group they are in according to the password database. Check both
27databases to get complete membership information.)
28
29It defines the following items:
30
31\begin{funcdesc}{getgrgid}{gid}
32Return the group database entry for the given numeric group ID.
33\exception{KeyError} is raised if the entry asked for cannot be found.
34\end{funcdesc}
35
36\begin{funcdesc}{getgrnam}{name}
37Return the group database entry for the given group name.
38\exception{KeyError} is raised if the entry asked for cannot be found.
39\end{funcdesc}
40
41\begin{funcdesc}{getgrall}{}
42Return a list of all available group entries, in arbitrary order.
43\end{funcdesc}
44
45
46\begin{seealso}
47 \seemodule{pwd}{An interface to the user database, similar to this.}
48 \seemodule{spwd}{An interface to the shadow password database, similar to this.}
49\end{seealso}
Note: See TracBrowser for help on using the repository browser.