1.fp 5 CW 2.de Af 3.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2 4.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" 5.. 6.de aF 7.ie \\$3 .ft \\$1 8.el \{\ 9.ds ;G \& 10.nr ;G \\n(.f 11.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" 12\\*(;G 13.ft \\n(;G \} 14.. 15.de L 16.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" 17.. 18.de LR 19.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" 20.. 21.de RL 22.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" 23.. 24.de EX \" start example 25.ta 1i 2i 3i 4i 5i 6i 26.PP 27.RS 28.PD 0 29.ft 5 30.nf 31.. 32.de EE \" end example 33.fi 34.ft 35.PD 36.RE 37.PP 38.. 39.TH STRPERM 3 40.SH NAME 41strperm \- evaluate file permission expression 42.SH SYNOPSIS 43.L "int strperm(char* s, char** e, int p)" 44.SH DESCRIPTION 45.I strperm 46applies a file permission expression in the nul-terminated string 47.I s 48to the initial file permission mask 49.IR p . 50The new permission mask is returned. 51If 52.I e 53not 0 then 54.I *e 55is set to point to the first unrecognized character in 56.IR s . 57.PP 58A tape device specification is composed of one or more 59.I who-op-permission 60terms separated by 61.BR , . 62.I who 63selects portions of the permission bits and may be any combination of: 64.TP 3 65.B u 66the user permission bits; 67.TP 68.B g 69the group permission bits; 70.TP 71.B o 72the `other' permission bits; 73.TP 74.B a 75all permission bits. 76.PP 77If omitted, all permission bits are selected. 78.I op 79specifies how the original permission 80.I p 81is to be modified: 82.TP 3 83.B + 84.br 85.ns 86.B | 87the new bits are set in 88.IR p ; 89.TP 3 90.B \- 91the new bits are cleared in 92.IR p ; 93.TP 94.B & 95the new bits are and'd with 96.IR p ; 97.TP 98.B = 99the select bits in 100.I p 101are set equal to the new bits 102.PP 103A permission expression term may also be an octal number. 104Octal specifications are inherently non-portable. 105Refer to 106.IR chmod (1) 107for an explanation of this form. 108.SH "SEE ALSO" 109chmod(1), ls(1), strmode(3) 110