level 5
最爱仓木麻衣
楼主
#include
#include
#include
#include
int main(int argc, char **argv){ struct stat statbuf; struct utimbuf timebuf; if (argc != 2) { printf("a.out filename"); getchar(); exit(8); } if (stat(argv[1], &statbuf) < 0) { printf("%s: stat error", argv[1]); getchar(); exit(8); } if (open(argv[1], O_RDWR|O_TRUNC) < 0) { printf("%s, open error", argv[1]); getchar(); exit(8); } timebuf.actime = statbuf.st_atime; timebuf.modtime = statbuf.st_mtime; if (utime(argv[1], &timebuf)< 0) { printf("%s, utime error", argv[1]); getchar(); exit(8); } getchar(); exit(0);}
2005年11月16日 12点11分
1
#include
#include
#include
int main(int argc, char **argv){ struct stat statbuf; struct utimbuf timebuf; if (argc != 2) { printf("a.out filename"); getchar(); exit(8); } if (stat(argv[1], &statbuf) < 0) { printf("%s: stat error", argv[1]); getchar(); exit(8); } if (open(argv[1], O_RDWR|O_TRUNC) < 0) { printf("%s, open error", argv[1]); getchar(); exit(8); } timebuf.actime = statbuf.st_atime; timebuf.modtime = statbuf.st_mtime; if (utime(argv[1], &timebuf)< 0) { printf("%s, utime error", argv[1]); getchar(); exit(8); } getchar(); exit(0);}