<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>luaposix 33.3.0 Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>luaposix 33.3.0</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/posix.html">posix</a></li>
<li><a href="../modules/posix.ctype.html">posix.ctype</a></li>
<li><a href="../modules/posix.curses.html">posix.curses</a></li>
<li><a href="../modules/posix.dirent.html">posix.dirent</a></li>
<li><a href="../modules/posix.errno.html">posix.errno</a></li>
<li><a href="../modules/posix.fcntl.html">posix.fcntl</a></li>
<li><a href="../modules/posix.fnmatch.html">posix.fnmatch</a></li>
<li><a href="../modules/posix.getopt.html">posix.getopt</a></li>
<li><a href="../modules/posix.glob.html">posix.glob</a></li>
<li><a href="../modules/posix.grp.html">posix.grp</a></li>
<li><a href="../modules/posix.libgen.html">posix.libgen</a></li>
<li><a href="../modules/posix.poll.html">posix.poll</a></li>
<li><strong>posix.pwd</strong></li>
<li><a href="../modules/posix.sched.html">posix.sched</a></li>
<li><a href="../modules/posix.signal.html">posix.signal</a></li>
<li><a href="../modules/posix.stdio.html">posix.stdio</a></li>
<li><a href="../modules/posix.stdlib.html">posix.stdlib</a></li>
<li><a href="../modules/posix.sys.msg.html">posix.sys.msg</a></li>
<li><a href="../modules/posix.sys.resource.html">posix.sys.resource</a></li>
<li><a href="../modules/posix.sys.socket.html">posix.sys.socket</a></li>
<li><a href="../modules/posix.sys.stat.html">posix.sys.stat</a></li>
<li><a href="../modules/posix.sys.statvfs.html">posix.sys.statvfs</a></li>
<li><a href="../modules/posix.sys.time.html">posix.sys.time</a></li>
<li><a href="../modules/posix.sys.times.html">posix.sys.times</a></li>
<li><a href="../modules/posix.sys.utsname.html">posix.sys.utsname</a></li>
<li><a href="../modules/posix.sys.wait.html">posix.sys.wait</a></li>
<li><a href="../modules/posix.syslog.html">posix.syslog</a></li>
<li><a href="../modules/posix.termio.html">posix.termio</a></li>
<li><a href="../modules/posix.time.html">posix.time</a></li>
<li><a href="../modules/posix.unistd.html">posix.unistd</a></li>
<li><a href="../modules/posix.utime.html">posix.utime</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/posix.curses.chstr.html">posix.curses.chstr</a></li>
<li><a href="../classes/posix.curses.window.html">posix.curses.window</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/curses.lua.html">curses.lua</a></li>
<li><a href="../examples/dir.lua.html">dir.lua</a></li>
<li><a href="../examples/fork.lua.html">fork.lua</a></li>
<li><a href="../examples/fork2.lua.html">fork2.lua</a></li>
<li><a href="../examples/getopt.lua.html">getopt.lua</a></li>
<li><a href="../examples/glob.lua.html">glob.lua</a></li>
<li><a href="../examples/limit.lua.html">limit.lua</a></li>
<li><a href="../examples/lock.lua.html">lock.lua</a></li>
<li><a href="../examples/netlink-uevent.lua.html">netlink-uevent.lua</a></li>
<li><a href="../examples/ping.lua.html">ping.lua</a></li>
<li><a href="../examples/poll.lua.html">poll.lua</a></li>
<li><a href="../examples/rt_sched.lua.html">rt_sched.lua</a></li>
<li><a href="../examples/signal.lua.html">signal.lua</a></li>
<li><a href="../examples/socket.lua.html">socket.lua</a></li>
<li><a href="../examples/termios.lua.html">termios.lua</a></li>
<li><a href="../examples/tree.lua.html">tree.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>posix.pwd</code></h1>
<p>Password Database Operations.</p>
<p> Query the system password database.</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#endpwent">endpwent ()</a></td>
<td class="summary">Release password database resources.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getpwent">getpwent ()</a></td>
<td class="summary">Fetch next password entry.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getpwnam">getpwnam (name)</a></td>
<td class="summary">Fetch named user.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getpwuid">getpwuid (uid)</a></td>
<td class="summary">Fetch password entry with given user id.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#setpwent">setpwent ()</a></td>
<td class="summary">Rewind next <a href="../modules/posix.pwd.html#getpwent">getpwent</a> back to start of database.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#PosixPasswd">PosixPasswd</a></td>
<td class="summary">Password record.</td>
</tr>
</table>
<br/>
<br/>
<h2><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "endpwent"></a>
<strong>endpwent ()</strong>
</dt>
<dd>
Release password database resources.
<h3>See also:</h3>
<ul>
<a href="../modules/posix.pwd.html#getpwent">getpwent</a>
</ul>
</dd>
<dt>
<a name = "getpwent"></a>
<strong>getpwent ()</strong>
</dt>
<dd>
Fetch next password entry.
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../modules/posix.pwd.html#PosixPasswd">PosixPasswd</a></span>
next password record
</ol>
<h3>See also:</h3>
<ul>
<a href="../modules/posix.pwd.html#endpwent">endpwent</a>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">
t = P.getpwent ()
<span class="keyword">while</span> t ~= <span class="keyword">nil</span> <span class="keyword">do</span>
process (t)
t = P.getpwent ()
<span class="keyword">end</span>
P.endpwent ()</pre>
</ul>
</dd>
<dt>
<a name = "getpwnam"></a>
<strong>getpwnam (name)</strong>
</dt>
<dd>
Fetch named user.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
user name
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../modules/posix.pwd.html#PosixPasswd">PosixPasswd</a></span>
passwd record for <em>name</em>
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">t = P.getpwnam <span class="string">"root"</span></pre>
</ul>
</dd>
<dt>
<a name = "getpwuid"></a>
<strong>getpwuid (uid)</strong>
</dt>
<dd>
Fetch password entry with given user id.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">uid</span>
<span class="types"><span class="type">int</span></span>
user id
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../modules/posix.pwd.html#PosixPasswd">PosixPasswd</a></span>
passwd record for <em>uid</em>
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">t = P.getpwuid (<span class="number">0</span>)</pre>
</ul>
</dd>
<dt>
<a name = "setpwent"></a>
<strong>setpwent ()</strong>
</dt>
<dd>
Rewind next <a href="../modules/posix.pwd.html#getpwent">getpwent</a> back to start of database.
<h3>See also:</h3>
<ul>
<a href="../modules/posix.pwd.html#getpwent">getpwent</a>
</ul>
</dd>
</dl>
<h2><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "PosixPasswd"></a>
<strong>PosixPasswd</strong>
</dt>
<dd>
Password record.
<h3>Fields:</h3>
<ul>
<li><span class="parameter">pw_name</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
user's login name
</li>
<li><span class="parameter">pw_uid</span>
<span class="types"><span class="type">int</span></span>
unique user id
</li>
<li><span class="parameter">pw_gid</span>
<span class="types"><span class="type">int</span></span>
user's default group id
</li>
<li><span class="parameter">pw_dir</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
initial working directory
</li>
<li><span class="parameter">pw_shell</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
user's login shell path
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-03-01 09:06:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>