- 论坛徽章:
- 1
|
原帖由 cjaizss 于 2006-4-28 15:51 发表
LZ先把代码贴出来
图片上就是代码
不过我还是帖一份吧。
- $ cat ttt.c
- # include <sys/stat.h>
- # include <errno.h>
- char *filename = "/etc/passwd";
- int main( void )
- {
- struct stat statbuf;
- if ( stat(filename, &statbuf) == -1 ){
- perror( filename );
- return -1;
- }
- printf( "Size: %ld\n", statbuf.st_size );
- printf( "Last Access Time: %s", ctime( &statbuf.st_atime ) );
- printf( "Size: %ld \t Last Access Time: %s\n", statbuf.st_size, ctime( &(statbuf.st_atime) ) );
- printf( "\n------------\n" );
- return 0;
- }
复制代码
[ 本帖最后由 wingger 于 2006-4-28 16:03 编辑 ] |
|