⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stat.2

📁 UNIX v6源代码 这几乎是最经典的unix版本 unix操作系统设计和莱昂氏unix源代码分析都是用的该版
💻 2
字号:
.th STAT II 8/5/73.sh NAMEstat \*- get file status.sh SYNOPSIS(stat = 18.).br.ft Bsys stat; name; buf.s3stat(name, buf).brchar *name;.brstruct inode *buf;.ft R.sh DESCRIPTION.it Namepoints to a null-terminated string naminga file;.it bufis the address of a 36(10) byte bufferinto which information is placed concerning the file.It is unnecessary to have anypermissions at all with respect to the file, but all directoriesleading to the file must be readable.After.it stat,.it bufhas the following structure (starting offset given in bytes):.s3.if t .ta .5i 1i 2.5i.if n .ta 3 9 24.nfstruct inode {	char	minor;	/* +0: minor device of i-node */	char	major;	/* +1: major device */	int	inumber;	/* +2 */	int	flags;	/* +4: see below */	char	nlinks;	/* +6: number of links to file */	char	uid;	/* +7: user ID of owner */	char	gid;	/* +8: group ID of owner */	char	size0;	/* +9: high byte of 24-bit size */	int	size1;	/* +10: low word of 24-bit size */	int	addr[8];	/* +12: block numbers or device number */	int	actime[2];	/* +28: time of last access */	int	modtime[2];	/* +32: time of last modification */};.fi.s3The flags are as follows:.s3.lp +10 9100000	i-node is allocated.lp +10 9060000	2-bit file type:.lp +15 9000000	plain file.lp +15 9040000	directory.lp +15 9020000	character-type special file.lp +15 9060000	block-type special file..lp +10 9010000	large file.lp +10 9004000	set user-ID on execution.lp +10 9002000	set group-ID on execution.lp +10 9001000	save text image after execution.lp +10 9000400	read (owner).lp +10 9000200	write (owner).lp +10 9000100	execute (owner).lp +10 9000070	read, write, execute (group).lp +10 9000007	read, write, execute (others).i0.sh "SEE ALSO"ls (I), fstat (II), fs (V).sh DIAGNOSTICSError bit (c-bit)is set if the file cannot be found.From C, a \*-1 return indicates an error.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -