*BSD News Article 30834


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!grivel!alsvid.scu.edu.au!pshepher
From: pshepher@scu.edu.au (Philip Shepherd)
Newsgroups: comp.unix.bsd
Subject: ?Perl/C access to wtmp,utmp?
Message-ID: <Cq8tnv.EvA@scu.edu.au>
Date: 23 May 94 06:50:19 GMT
Organization: Southern Cross University
Lines: 12
X-Newsreader: TIN [version 1.2 PL2]

Is there any easy way to access the info stored in the 'wtmp' and 'utmp'
files from Perl or C?

In particular, I'm interested in the number of minutes a user has been 
logged in ... this CAN be deduced from the 'login at' field of the 'w'
command but ends up being very inefficient (especially in perl).


-- 
Philip 	Shepherd                      Internet: phil@scu.edu.au
Southern Cross University
Lismore NSW Australia