Pike v8.0 release 1738

Method System.getpwent()


Method getpwent

array(int|string) getpwent()

Description

When first called, the getpwent function opens the passwd source and returns the first record using the systemfunction getpwent(3). For each following call, it returns the next record until EOF.

Call endpwent when done using getpwent.

Returns

An array with the information about the user

Array
string 0

Users username (loginname)

string 1

User password (encrypted)

int 2

Users ID

int 3

Users primary group ID

string 4

Users real name an possibly some other info

string 5

Users home directory

string 6

Users shell

0 if EOF.

See also

get_all_users() getpwnam() getpwent() setpwent() endpwent()