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

📄 touch.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
字号:
#ifndef lintstatic char *sccsid = "@(#)touch.c	4.1      (ULTRIX)        7/2/90";#endif lint#ifdef KERNEL#include "../h/types.h"#include "../h/stat.h"#else KERNEL#include <sys/types.h>#include <sys/stat.h>#endif KERNELmain(argc, argv)	int argc;	char **argv;{	argc--, argv++;	while (argc > 0) {		struct stat stb; int c, f;		if (stat(*argv, &stb) < 0)			goto bad;		if (chmod(*argv, stb.st_mode | 0200) < 0)			goto bad;		f = open(*argv, 2);		if (f < 0)			goto bad;		lseek(f, 0, 0);		read(f, &c, 1);		lseek(f, 0, 0);		write(f, &c, 1);		close(f);		chmod(*argv, stb.st_mode);		argc--, argv++;		continue;bad:		perror(*argv);		argc--, argv++;		continue;	}}

⌨️ 快捷键说明

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