- 论坛徽章:
- 0
|
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
int main()
{
char *filename="/etc/hello.c";
struct stat info;
memset(&info, 0, sizeof(struct stat));
stat(filename, &info);
printf("size: %d\n", info.st_size);
printf("mtime:%d\n",info.st_mtime);
return 0;
}
|
运行结果
[root@localhost code]# ./stat
size: 4
mtime:1242907708
如何打印出时间呢? |
|