summaryrefslogtreecommitdiff
path: root/ext/etc/etc.txt
blob: 9801dc0e023a0af9e4bb4d2915f9b8cf3dd7a5d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.\" etc.doc -  -*- Indented-Text -*- created at: Fri Jul 14 00:47:15 JST 1995

** Etc(Module)

The module to retrieve information under /etc directory.  Available
only on UNIX platforms.  All operations defined in this module are
module functions, so that you can include Etc module into your class.

Module Function:

   getlogin

	returns login name of the user.  It this fails, try getpwuid().

   getpwnam(name)

	searches in /etc/passwd file (or equivalent database), and
	returns password entry for the user.  The return value is an
	passwd structure, which has members described below.

	  struct passwd
	    name 	# user name(string)
	    passwd	# encrypted password(string)
	    uid		# user ID(integer)
	    gid		# group ID(integer)
	    gecos	# gecos field(string)
	    dir		# home directory(string)
	    shell	# login shell(string)
	    # members below are optional
	    change	# password change time(integer)
	    quota	# quota value(integer)
	    age		# password age(integer)
	    class	# user access class(string)
	    comment	# comment(string)
	    expire	# account expiration time(integer)	    
	  end

	See getpwnam(3) for detail.

   getpwuid([uid])

	returns passwd entry for the specified user id.  If uid is
	ommitted, use the value from getuid().  See getpwuid(3) for
	detail.

   getgrgid(gid)

	searches in /etc/group file (or equivalent database), and
	returns group entry for the group id.  The return value is an
	group structure, which has members described below.

	  struct group
	    name 	# group name(string)
	    passwd	# group password(string)
	    gid		# group ID(integer)
	    mem		# array of the group member names
	  end

	See getgrgid(3) for detail.

   getgrnam(name)

	returns the group entry for the specified name.  The return
	value is the group structure.  See getgrnam(3) for detail.

   group

	iterates over all group entries.

   passwd

	iterates over all passwd entries.