在Linux系统中,系统是通过inode来获得这个文件的信息。在Linux系统中,inode的信息都是封装在stat这个结构体中。可以通过man 2 stat来查看stat的具体结构。从中可以看到包含了文件的UID,GID,大小,以及访问,修改,改变文件状态的时间
struct stat {
dev_t st_dev; /* ID of device containing file */
ino_t st_ino; /* inode number */
mode_t st_mode; /* protection */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of owner */
gid_t st_gid; /* group ID of owner */
dev_t st_rdev; /* device ID (if special file) */
off_t st_size; /* total size, in bytes */
blksize_t st_blksize; /* blocksize for filesystem I/O */
blkcnt_t st_blocks; /* number of 512B blocks allocated */
/*Since Linux 2.6, the kernel supports nanosecond
precisionfor the following timestamp fields.
Forthe details before Linux 2.6, see NOTES. */
structtimespec st_atim; /* time of last access */
structtimespec st_mtim; /* time of last modification */
structtimespec st_ctim; /* time of last status change */