Idle Time: Finger knows, Why can't I? ,-----access They generally use stat() to read the modification time of the user's terminal device. Whenever input for a terminal arrives, the tty driver updates the modification time of the corresponding /dev/ttyX special file. Programs like finger look in /etc/utmp to learn the tty that a user logged in on (see the man page for utmp(5)), prepend "/dev/" to it, and stat() it. Barry Margolin -- barmar@think.com When a "read()" on a terminal succeeds - which generally means "when data arrives on the terminal" - the access time is updated. Note also that if you have a machine with a directly-attached keyboard (workstation or PCish machine) and possibly a mouse, you may also want to check the access time on the keyboard or mouse if the user is on the console; at least some parts of SunOS do that, by checking the access time on "/dev/kbd" and "/dev/mouse", for example (if you aren't running SunOS, you're on your own and will have to find out the right devices yourself). There may be other input devices of interest as well.... (At least on SunOS with some flavors of X, this unfortunately doesn't work, as the way X handles the keyboard and mouse causes the access time to be updated even when nothing is done with the keyboard or mouse.) Guy Harris --- guy@Auspex.COM