?? stat.2
字號:
.TH STAT 2 .SH NAMEstat, fstat \- get file status.SH SYNOPSIS.B #include <sys/types.h>.br.B #include <sys/stat.h>.PP.B stat(name, buf).br.B char *name;.br.B struct stat *buf;.PP.B fstat(fildes, buf).br.B struct stat *buf;.SH DESCRIPTION.I Statobtains detailed information about a named file..I Fstatobtains the same information about an open fileknown by the file descriptor from a successful.I open, creat, dupor.IR pipe (2)call..PP.I Namepoints to a null-terminated string naminga file;.I bufis the address of a 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 searchable.The layout of the structure pointed to by bufas defined in.I <stat.h>is given below..I St_mode is encoded according to the `#define' statements..PP.nf.so /usr/include/sys/stat.h.fi.PPThe mode bits 0000070 and 0000007 encode group andothers permissions (see.IR chmod (2)).The defined types,.I ino_t, off_t, time_t,name various width integer values;.I dev_tencodesmajor and minor device numbers;their exact definitions are inthe include file <sys/types.h>(see.IR types (5)..PPWhen.I fildesis associated with a pipe,.I fstatreports an ordinary filewith restricted permissions.The size is the number of bytes queued in the pipe..PP.I st_atimeis the file was last read.For reasons of efficiency, it is not set when a directoryis searched, although this would be more logical..I st_mtimeis the time the file was last written or created.It is not set by changes of owner, group, link count, or mode..I st_ctimeis set both both by writing and changing the i-node..SH "SEE ALSO"ls(1), filsys(5).SH DIAGNOSTICSZero is returned if a status is available;\-1 if the file cannot be found..SH ASSEMBLER(stat = 18.).br.B sys stat; name; buf.PP(fstat = 28.).br(file descriptor in r0).br.B sys fstat; buf
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -