c - How to display uid, size and file's type? -
i'm using gcc 32bit compiler. used stat() function, not giving information type of file. there function or way find these? i believe looking st_mode member of struct stat. from stat(2) manpage: status information word st_mode has following bits: #define s_ifmt 0170000 /* type of file */ #define s_ififo 0010000 /* named pipe (fifo) */ #define s_ifchr 0020000 /* character special */ #define s_ifdir 0040000 /* directory */ #define s_ifblk 0060000 /* block special */ #define s_ifreg 0100000 /* regular */ #define s_iflnk 0120000 /* symbolic link */ #define s_ifsock 0140000 /* socket */ #define s_ifwht 0160000 /* whiteout */ #define s_isuid 0004000 /* set user id on execution */ #define s_isgid 0002000 /* set group id on execution */ #define s_isvtx 0001000 /* save swapped text after use */ #define s_irusr 0000400 /* read permission, owner */ #define s_iwusr 0000200 ...