Sanchit Sahay

Systems, Virtualization, Web, Cloud and More!
HomeProjectsPocket Litter
stat(2) mode visualizer.
Source Code Request a Feature

A Linux/Unix stat(2) mode bit visualizer for decoding file type bits, permission bits, and special mode flags. Build your own mode flag, interpret an existing one, and know what checks to perform.

Special
Owner
Group
Other
File type-
Special behaviorsetgid
Owner permissionsrw-
Group permissions--x
Other permissionsr-x
Can owner read?(mode & S_IRUSR)
Can owner write?(mode & S_IWUSR)
Can owner execute?(mode & S_IXUSR)
Can group read?(mode & S_IRGRP)
Can group write?(mode & S_IWGRP)
Can group execute?(mode & S_IXGRP)
Can other read?(mode & S_IROTH)
Can other write?(mode & S_IWOTH)
Can other execute?(mode & S_IXOTH)
Is this a regular file?((mode & S_IFMT) == S_IFREG)
Is this a directory?((mode & S_IFMT) == S_IFDIR)
Is this a socket?((mode & S_IFMT) == S_IFSOCK)
Is this a symbolic link?((mode & S_IFMT) == S_IFLNK)
Is this a block device?((mode & S_IFMT) == S_IFBLK)
Is this a character device?((mode & S_IFMT) == S_IFCHR)
Is this a fifo?((mode & S_IFMT) == S_IFIFO)
Is setuid enabled?(mode & S_ISUID)
Is setgid enabled?(mode & S_ISGID)
Is sticky enabled?(mode & S_ISVTX)