home *** CD-ROM | disk | FTP | other *** search
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <string.h>
- #include "config.h"
-
- extern char mail[];
-
- #ifdef MAILCHECK
- void mailcheck ()
- {
- struct stat statbuf;
- char *mailbox;
-
- if (mailbox = strchr (mail, '='))
- mailbox++;
- else
- return;
-
- if (stat (mailbox, &statbuf) == -1 || statbuf.st_size == 0)
- puts ("No mail.");
- else if (statbuf.st_atime > statbuf.st_mtime)
- puts ("You have mail.");
- else
- puts ("You have new mail.");
- }
- #endif
-