01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

STAT ( 2 ) STAT ( 2 )<br />

NAME<br />

stat, fstat - get file status<br />

SYNOPSIS<br />

#include <br />

#include <br />

int stat (path, bur)<br />

char *path;<br />

struct stat •bur;<br />

int rstat (tildes, bur)<br />

int tildes;<br />

struct stat •bur;<br />

DESCRIPTION<br />

Path points to a path name naming a file. Read, write or execute<br />

permission of the named file is not required, but all directories<br />

listed in the path name leading to the file must be searchable.<br />

Stat obtains information about the named file.<br />

Similarly, fstat obtains information about an open file known by<br />

the file descriptor fildes, obtained from a successful open, ere at,<br />

dup , fcntl, or pipe system call.<br />

Buf is a pointer to a stat structure into which information is<br />

placed concerning the file.<br />

The contents of the structure pointed to by buf include the following<br />

members:<br />

dev_t<br />

ino_t<br />

ushort<br />

short<br />

ushort<br />

ushort<br />

dev_t<br />

off_t<br />

time_t<br />

time_t<br />

time_t<br />

st_dev;<br />

st_ino;<br />

st_mode;<br />

st_nlink;<br />

st_uid;<br />

st_gid;<br />

st_rdev;<br />

st_size;<br />

st_atime;<br />

st_mtime;<br />

st_ctime;<br />

/• ID of device containing •I<br />

I* a directory entry for this file •/<br />

I* Inode number *I<br />

I• File mode; see mknod(2) •I<br />

I* Number of links •I<br />

I* User ID of the file's owner •I<br />

I* Group ID of the file's group •I<br />

I* ID of device •I<br />

I* This entry is defined only for *I<br />

I• character special or block •I<br />

I* special files •I<br />

I* File size in bytes *I<br />

I• Time of last access *I<br />

I* Time of last data modification *I<br />

I• Time of last file status change •I<br />

I* Times measured in seconds •I<br />

I* since 00:00:00 GMT, *I<br />

I* Jan. 1, 1970 •I<br />

st_atime Time when file data was last accessed. Changed by<br />

the following system calls: creat(2), mknod(2),<br />

pipe(2), utime (2), and read(2).<br />

st_mtime Time when data was last modified. Changed by the<br />

following system calls: creat(2), mknod(2), pipe(2),<br />

utime(2), and write(2).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!