User::Utmp

User::Utmp is a Perl access to utmp- and utmpx-style databases.
Download

User::Utmp Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Michael Piotrowski
  • Publisher web site:
  • http://search.cpan.org/~mpiotr/User-Utmp-1.8/Utmp.pm

User::Utmp Tags


User::Utmp Description

User::Utmp is a Perl access to utmp- and utmpx-style databases. User::Utmp is a Perl access to utmp- and utmpx-style databases.SYNOPSIS use User::Utmp qw(:constants :utmpx); @utmp = getutx();or, using utmp: use User::Utmp qw(:constants :utmp); @utmp = getut();UNIX systems record information about current and past logins in a user accounting database. This database is realized by two files: File utmpx contains a record of all users currently logged onto the system, while file wtmpx contains a record of all logins and logouts. Some systems (such as HP-UX and AIX) also maintain a third file containing failed login attempts. The information in these files is used by commands such as who(1), last(1), write(1), or login(1).The exact location of these files in the file system varies between operating systems, but they are typically stored in directories like /var/adm, /var/run, or /var/log. The Single UNIX Specification specifies an API for reading from and writing to these files.The utmpx file format and functions were derived from the older utmp file format and functions. For compatibility reasons, many systems still support the utmp functions and maintain utmp database files. It is recommended, however, to use the utmpx functions instead of the obsolete utmp functions.The User::Utmp module provides functions for reading and writing utmpx and utmp files by providing a Perl interface to the system functions.Utmpx and utmp records are represented in Perl by hash references. The hash keys are the names of the elements of the utmpx structure. For details consult utmpx(4) (utmpx(5) on some systems). The hash values are (mostly) the same as in C.As an example, here is a typical record as it may be returned by the getutxent(), getutxid(), getutxline() or the corresponding utmp functions: {ut_tv => {tv_sec => 1141256698, tv_usec => 0}, ut_line => "ttyp0", ut_time => 1141256698, ut_id => "p0", ut_host => ":0.0", ut_exit => {e_termination => 0, e_exit => 2}, ut_pid => 4577, ut_user => "mxp", ut_type => USER_PROCESS,}The array returned by the getutx() and getut() functions is composed of hash references like this. Requirements: · Perl


User::Utmp Related Software