Cmail - check to see who's read their mail - UNIX

Tom Christiansen tchrist at convex.COM
Tue Oct 24 23:45:49 AEST 1989


In article <4006 at helios.ee.lbl.gov>,
leres at helios.ee.lbl.gov (Craig Leres) writes:

>Note that if a user is logged in and uses biff (or sysline), you can't
>really tell when mail was last read since biff reads new messages as
>they arrive. This is particuarly a problem if the person stays logged
>into a workstation 24 hours a day...

Only if your vendor hasn't fixed biff(1) to save the st_atime from when
it stats the file and restore it with utimes(2) after you're done reading.
Once this is done, your shell can do this on login:

    if ($st_size) {
	printf "You have %s mail.\n", $st_atime > $st_mtime ? "old" : "new";
    }

oops, that was in perl not C :-)  (i just wrote the perl translation 
to cmail and posted it to alt.sources)   you see what i mean though.

--tom

    Tom Christiansen                       {uunet,uiucdcs,sun}!convex!tchrist 
    Convex Computer Corporation                            tchrist at convex.COM
		 "EMACS belongs in <sys/errno.h>: Editor too big!"



More information about the Alt.sources.d mailing list