Programming and posix - April 2002
April 3, 2002
Solution Symposium
Page 37
hp e3000
programming
and posix
file management - stat()
• int stat (const char *path, struct stat *buffer);
• int fstat (int fildes, struct stat *buffer);
• int lstat (const char *path, struct stat *buffer);
• reports on the symlink instead of the target file
• obtains file attributes
• some struct stat fields from <sys/stat.h>:
• st_mode - permission modes
• st_uid, st_gid - POSIX uid & gid of owner
• st_size - file size in bytes
• st_atime, st_mtime, st_ctime - accessed,
modified, created timestamps