output file device

pull/6/head
yuqing 2016-02-02 15:05:30 +08:00
parent 6c74629633
commit b1a6bbfa27
1 changed files with 2 additions and 1 deletions

View File

@ -121,8 +121,9 @@ int main(int argc, char *argv[])
printf("procs: %d\n", info.procs); printf("procs: %d\n", info.procs);
} }
stat("/dev/null", &st); stat("/etc/passwd", &st);
printf("file inode: %ld\n", (long)st.st_ino); printf("file inode: %ld\n", (long)st.st_ino);
printf("file device: %"PRId64"\n", *((int64_t *)&st.st_dev));
printf("file access time: %d.%ld\n", (int)st.st_atime, st.st_atimensec); printf("file access time: %d.%ld\n", (int)st.st_atime, st.st_atimensec);
printf("file modify time: %d.%ld\n", (int)st.st_mtime, st.st_mtimensec); printf("file modify time: %d.%ld\n", (int)st.st_mtime, st.st_mtimensec);
printf("file change time: %d.%ld\n", (int)st.st_ctime, st.st_ctimensec); printf("file change time: %d.%ld\n", (int)st.st_ctime, st.st_ctimensec);