- 论坛徽章:
- 0
|
find 中的 -ctime 和 -mtime ,-atime 区别?
[这个贴子最后由valentine在 2002/08/22 02:02pm 编辑]
没有什么工具显示,(可能是俺不知道)
把下面程序里的st_mtime换成st_ctime,或st_atime便可以得到你要的了.
#include <sys/stat.h>
int
main (int argc, char **argv)
{
struct stat buf;
char date[80];
char fname[80];
printf("Enter filename (with full path) to check mtime : ";
scanf("%s",fname);
stat(fname, &buf);
printf ("mtime (in sec) of %s = %ld\n", fname, buf.st_mtime);
strcpy(date, ctime((time_t *)&(buf.st_mtime)));
printf ("mtime (in date) of %s = %s\n", fname, date);
}
至于文件备份,有什么不可以的么?
|
|