When a program calls the stat( ) function for a given file, the system returns a structure that provides information about the file. The specific details of the structure should be obtained from your platform’s implementation, but the basic outline of the structure is as follows:
struct stat {
dev_t st_dev; /* device of inode */
inot_t st_ino; /* inode number */
short st_mode; /* mode bits */
short st_nlink; /* number of links to file /*
short st_uid; /* owner’s user id */
short st_gid; /* owner’s group id */
dev_t st_rdev; /* for special files */
off_t st_size; /* file size in characters */
time_t st_atime; /* time last accessed */
time_t st_mtime; /* time last modified */
time_t st_ctime; /* time inode last changed*/
}
|
The elements that are most significant for server plug-in API activities are st_size, st_atime, st_mtime, and st_ctime.