代码拉取完成,页面将自动刷新
#include<stdio.h>
#include<time.h>
#include<sys/stat.h>
#include<unistd.h>
#include<sys/types.h>
#include<errno.h>
#include<stdlib.h>
int main(int argc, char **argv)
{
struct stat buf;
/检查参数个数/
if(argc!=2)
{
perror("Usage:my_stat \n");
exit(1);
}
/获取文件属性/
if( stat(argv[1], &buf) ==-1 )
{
perror("stat:");
exit(1);
}
printf("device is: %d\n",buf.st_dev);
printf("inode is : %d\n",buf.st_ino);
printf("mode is: %o\n",buf.st_mode);
printf("number of hard links is: %d\n",buf.st_nlink);
printf("user ID of owner is: %d\n",buf.st_uid);
printf("group ID of owner is: %d\n",buf.st_gid);
printf("device type (if inode device )is: %d\n",buf.st_rdev);
printf("total size ,in bytes is: %d\n",buf.st_size);
printf("blocksize for filesystem I/O is: %d\n",buf.st_blksize);
printf("number of blocks allocated is: %d\n",buf.st_blocks);
printf("time of lasst access is: %s",ctime(&buf.st_atime));
printf("time of last modification is: %s",ctime(&buf.st_mtime));
printf("time of last chage is: %s",ctime(&buf.st_ctime));
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。