⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdmail.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
字号:
#ifndef lintstatic char sccsid[] = "@(#)sdmail.c	4.1	(ULTRIX)	7/2/90";#endif#include "uucp.h"#include <pwd.h>/******* *	sdmail(file, uid) * *	sdmail  -  this routine will determine the owner *	of the file (file), create a message string and *	call "mailst" to send the cleanup message. *	This is only implemented for local system *	mail at this time. */sdmail(file, uid)char *file;{	static struct passwd *pwd;	struct passwd *getpwuid();	char mstr[40];	sprintf(mstr, "uuclean deleted file %s\n", file);	if (pwd->pw_uid == uid) {		mailst(pwd->pw_name, mstr);	return(0);	}	setpwent();	if ((pwd = getpwuid(uid)) != NULL) {		mailst(pwd->pw_name, mstr);	}	return(0);}/*** *	mailst(user, str) *	char *user, *str; * *	mailst  -  this routine will fork and execute *	a mail command sending string (str) to user (user). */mailst(user, str)char *user, *str;{	FILE *fp;	char cmd[100];	sprintf(cmd, "mail %s", user);	if ((fp = popen(cmd, "w")) == NULL)		return;/* \n added to mail message.  uw-beave!jim (Jim Rees) */	fprintf(fp, "%s\n", str);	pclose(fp);	return;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -