da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.fp 5 CW
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de Af
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de aF
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ie \\$3 .ft \\$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.el \{\
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ds ;G \&
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.nr ;G \\n(.f
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin\\*(;G
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ft \\n(;G \}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de L
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de LR
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de RL
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EX \" start example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ta 1i 2i 3i 4i 5i 6i
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.RS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PD 0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ft 5
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.nf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EE \" end example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ft
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PD
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.RE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.TH MODECANON 3
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH NAME
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmodecanon \- canonical file mode representation
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH SYNOPSIS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <modex.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinint modei(int \fIexternal\fP);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinint modex(int \fIinternal\fP);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.EE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH DESCRIPTION
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPOSIX threw out the file type bit macros and replaced them with
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfunction-like macros that test file type.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThis is bad in many ways, the worst of which is that it provides
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinno way for a user program to synthesize file types in the mode bits.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.IR pax (1),
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.IR tar (1)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinand
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.IR cpio (1)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinare examples of user programs that must convert between the internal mode
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinrepresentation and a private external representation.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThese routines provide a canonical external representation
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinwith macros to access and synthesize the bits in the external
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinrepresentation.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L modei
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintakes an external mode representation
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I external
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinand returns the equivalent internal representation.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L modex
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintakes an internal mode representation
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I internal
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinand returns the equivalent external representation.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThe traditional bit access macro (\f5S_\fP prefix changes to \f5X_\fP) are:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IFMT ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IFSOCK ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IFLNK ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IFCTG ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IFREG ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IFBLK ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IFDIR ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IFCHR ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IFIFO ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IPERM ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_ISUID ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_ISGID ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_ISVTX ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IRUSR ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IWUSR ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IXUSR ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IRGRP ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IWGRP ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IXGRP ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IROTH ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IWOTH ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IXOTH ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IRWXU ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IRWXG
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinand
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L X_IRWXO .
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.LI X_ITYPE( mode )
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinreturns the type bits for
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.IR mode .
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH "SEE ALSO"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinpax(1), stat(2)