MODECANON(3)
π NAME π
modecanon β canonical file mode representation. Bestie, that's the whole name vibe: canonical file mode representation, slay. This is MODECANON(3) from the Library Functions Manual, and yes the manual name is folded in right here because we're cute like that. π
β¨ SYNOPSIS β¨
#include <modex.h>
int modei(int external); int modex(int internal);
π¦ DESCRIPTION π¦
Okay so POSIX threw out the file type bit macros and replaced them with function-like macros that test file type. This is bad in many ways β the worst of which is that it provides no way for a user program to synthesize file types in the mode bits. π
pax(1), tar(1) and cpio(1) are examples of user programs that must convert between the internal mode representation and a private external representation. These routines provide a canonical external representation with macros to access and synthesize the bits in the external representation. Iconic. β¨
modei takes an external mode representation external and returns the equivalent internal representation. π«Ά
modex takes an internal mode representation internal and returns the equivalent external representation. π
The traditional bit access macros β where the S_ prefix changes to X_ β are:
X_IFMTX_IFSOCKX_IFLNKX_IFCTGX_IFREGX_IFBLKX_IFDIRX_IFCHRX_IFIFOX_IPERMX_ISUIDX_ISGIDX_ISVTXX_IRUSRX_IWUSRX_IXUSRX_IRGRPX_IWGRPX_IXGRPX_IROTHX_IWOTHX_IXOTHX_IRWXUX_IRWXGX_IRWXO
X_ITYPE(mode) returns the type bits for mode. π
π SEE ALSO π
pax(1), stat(2) β go read those too, bestie. π
Cute sign-off: source/version is the MODECANON(3) page in the Library Functions Manual, and thereβs no separate date in the original footer β it just says MODECANON(3). π
π¦ where this page comes from
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms