home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
TELECOM
/
tass.lzh
/
mail.c
< prev
next >
Wrap
Text File
|
1993-01-24
|
1KB
|
56 lines
#include <stdio.h>
#ifndef OSK
#include <sys/types.h>
#include <sys/stat.h>
#else /* OSK */
#include <types.h>
#include <stat.h>
typedef long off_t;
#endif /* OSK */
#include "tass.h"
char *mailbox_name = NULL;
off_t mailbox_size;
/*
* Record size of mailbox so we can detect if new mail has arrived
*/
mail_setup() {
struct stat buf;
extern char *getenv();
if (do_mail_check) {
if (mailbox_name == NULL)
mailbox_name = getenv("MAIL");
if (mailbox_name == NULL)
mailbox_size = 0;
else {
if (stat(mailbox_name, &buf) >= 0)
mailbox_size = buf.st_size;
else
mailbox_size = 0;
}
}
}
/*
* Return TRUE if new mail has arrived
*/
mail_check() {
struct stat buf;
if (mailbox_name != NULL
&& stat(mailbox_name, &buf) >= 0
&& mailbox_size < buf.st_size)
return TRUE;
return FALSE;
}