当前位置: 技术问答>linux和unix
stat结构
来源: 互联网 发布时间:2017-01-07
本文导语: stat结构中的成员: 1. st_dev The st_dev value for every filename on a system is the device number of the file system containing that filename and its corresponding i-node. 什么叫“ the device number of the file system”? 文件系统的设...
stat结构中的成员:
1. st_dev
The st_dev value for every filename on a system is the device number of the file system containing that filename and its corresponding i-node.
什么叫“ the device number of the file system”? 文件系统的设备号?
2. st_rdev
This value contains the device number for the actual device.
还是不懂。。。
高手帮忙给解释解释阿,谢谢
1. st_dev
The st_dev value for every filename on a system is the device number of the file system containing that filename and its corresponding i-node.
什么叫“ the device number of the file system”? 文件系统的设备号?
2. st_rdev
This value contains the device number for the actual device.
还是不懂。。。
高手帮忙给解释解释阿,谢谢
|
任何一个设备在linux中都有一个设备节点,即一个特殊的文件,应用程序通过这个节点来访问设备,而访问设备就会要调用设备的驱动程序,至于调用哪个驱动程序则是有主设备号来指定的,另外还有次设备号。
|
st_dev 文件所在的文件系统的设备号。
st_rdev 文件本身的设备号(对字符和块设备文件才有意义)
dev_t st_dev ID of device containing file
ino_t st_ino file serial number
mode_t st_mode mode of file (see below)
nlink_t st_nlink number of links to the file
uid_t st_uid user ID of file
gid_t st_gid group ID of file
dev_t st_rdev device ID (if file is character or block special)
off_t st_size file size in bytes (if file is a regular file)
time_t st_atime time of last access
time_t st_mtime time of last data modification
time_t st_ctime time of last status change
blksize_t st_blksize a filesystem-specific preferred I/O block size for
this object. In some filesystem types, this may
vary from file to file
blkcnt_t st_blocks number of blocks allocated for this object
st_rdev 文件本身的设备号(对字符和块设备文件才有意义)
dev_t st_dev ID of device containing file
ino_t st_ino file serial number
mode_t st_mode mode of file (see below)
nlink_t st_nlink number of links to the file
uid_t st_uid user ID of file
gid_t st_gid group ID of file
dev_t st_rdev device ID (if file is character or block special)
off_t st_size file size in bytes (if file is a regular file)
time_t st_atime time of last access
time_t st_mtime time of last data modification
time_t st_ctime time of last status change
blksize_t st_blksize a filesystem-specific preferred I/O block size for
this object. In some filesystem types, this may
vary from file to file
blkcnt_t st_blocks number of blocks allocated for this object