Query: stat
OS: v7
Section: 2
Links: v7 man pages all man pages
Forums: unix linux community forum categories
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
STAT(2) System Calls Manual STAT(2)NAMEstat, fstat - get file statusSYNOPSIS#include <sys/types.h> #include <sys/stat.h> stat(name, buf) char *name; struct stat *buf; fstat(fildes, buf) struct stat *buf;DESCRIPTIONStat obtains detailed information about a named file. Fstat obtains the same information about an open file known by the file descriptor from a successful open, creat, dup or pipe(2) call. Name points to a null-terminated string naming a file; buf is the address of a buffer into which information is placed concerning the file. It is unnecessary to have any permissions at all with respect to the file, but all directories leading to the file must be searchable. The layout of the structure pointed to by buf as defined in <stat.h> is given below. St_mode is encoded according to the `#define' statements. The mode bits 0000070 and 0000007 encode group and others permissions (see chmod(2)). The defined types, ino_t, off_t, time_t, name vari- ous width integer values; dev_t encodes major and minor device numbers; their exact definitions are in the include file <sys/types.h> (see types(5). When fildes is associated with a pipe, fstat reports an ordinary file with restricted permissions. The size is the number of bytes queued in the pipe. st_atime is the file was last read. For reasons of efficiency, it is not set when a directory is searched, although this would be more logical. st_mtime is the time the file was last written or created. It is not set by changes of owner, group, link count, or mode. st_ctime is set both both by writing and changing the i-node.SEE ALSOls(1), filsys(5)DIAGNOSTICSZero is returned if a status is available; -1 if the file cannot be found.ASSEMBLER(stat = 18.) sys stat; name; buf (fstat = 28.) (file descriptor in r0) sys fstat; buf STAT(2)
Related Man Pages |
---|
stat(2) - bsd |
stat(2) - v7 |
lstat(2) - ultrix |
fstat(3p) - v7 |
fstat(3p) - minix |
Similar Topics in the Unix Linux Community |
---|
How can I make ls -l in HP-UNIX? |
Using stat() to determine file permissions |
Q with stat() |
Error in bits/stat.h |
Does PowerSHell have *stat command analogs? |