NAME
strmode — convert inode status information into a symbolic stringLIBRARY
library “libbsd”SYNOPSIS
#include <string.h> (See libbsd(7) for include usage.)void
strmode(mode_t mode, char *bp);
DESCRIPTION
The strmode() function converts a file mode (the type and permission information associated with an inode, see stat(2)) into a symbolic string which is stored in the location referenced by bp. This stored string is eleven characters in length plus a trailingNUL
.
The first character is the inode type, and will be one of the following:
- -
- regular file
- b
- block special
- c
- character special
- d
- directory
- l
- symbolic link
- p
- fifo
- s
- socket
- w
- whiteout
- ?
- unknown inode type
- S
- If the character is part of the owner permissions and the file is not executable or the directory is not searchable by the owner, and the set-user-id bit is set.
- S
- If the character is part of the group permissions and the file is not executable or the directory is not searchable by the group, and the set-group-id bit is set.
- T
- If the character is part of the other permissions and the
file is not executable or the directory is not searchable by others, and
the ``sticky'' (
S_ISVTX
) bit is set. - s
- If the character is part of the owner permissions and the file is executable or the directory searchable by the owner, and the set-user-id bit is set.
- s
- If the character is part of the group permissions and the file is executable or the directory searchable by the group, and the set-group-id bit is set.
- t
- If the character is part of the other permissions and the
file is executable or the directory searchable by others, and the
``sticky'' (
S_ISVTX
) bit is set. - x
- The file is executable or the directory is searchable.
- -
- None of the above apply.
SEE ALSO
chmod(1), find(1), stat(2), getmode(3bsd), setmode(3bsd)HISTORY
The strmode() function first appeared in 4.4BSD.July 28, 1994 | Debian |