* uuclean - this program will search through the spool
* directory (Spool) and delete all files with a requested
* prefix which are older than (nomtime) seconds.
* If the -m option is set, the program will try to
* send mail to the usid of the file.
* -m - send mail for deleted file
* -d - directory to clean
* -n - time to age files before delete (in hours)
* -x - turn on debug outputs
* 1 - can not read directory
#define NOMTIME 72 /* hours to age files before deletion */
nomtime
= NOMTIME
* 3600L;
while (argc
>1 && argv
[1][0] == '-') {
nomtime
= atoi(&argv
[1][2]) * 3600L;
Debug
= atoi(&argv
[1][2]);
printf("unknown flag %s\n", argv
[1]); break;
DEBUG(4, "DEBUG# %s\n", "START");
if ((pdirf
= fopen(Spool
, "r")) == NULL
) {
printf("%s directory unreadable\n", Spool
);
while (gnamef(pdirf
, file
)) {
if (stat(file
, &stbuf
) == -1) {
DEBUG(4, "stat on %s failed\n", file
);
if ((stbuf
.st_mode
& S_IFMT
) == S_IFDIR
)
if ((ptime
- stbuf
.st_ctime
) < nomtime
)
DEBUG(4, "unlink file %s\n", file
);
if (mflg
) sdmail(file
, stbuf
.st_uid
);
char Pre
[MAXPRE
][DIRSIZ
];
* chkpre(file) check for prefix
for (i
= 0; i
< Npre
; i
++) {
if (prefix(Pre
[i
], file
))