STRPERM(3ast) STRPERM(3ast)

# [NAME](#NAME)

strperm - evaluate file permission expression

# [SYNOPSIS](#SYNOPSIS)

int strperm(const char* s, char\** e, int p)

# [DESCRIPTION](#DESCRIPTION)

*strperm* applies a file permission expression in the null-terminated string *s* to the initial file permission mask *p*. The new permission mask is returned. If *e* not 0 then *\*e* is set to point to the first unrecognized character in *s*.

A tape device specification is composed of one or more *who-op-permission* terms separated by **,**. *who* selects portions of the permission bits and may be any combination of:

[**u**](#u)

the user permission bits;

[**g**](#g)

the group permission bits;

[**o**](#o)

the \`other' permission bits;

[**a**](#a)

all permission bits.

If omitted, all permission bits are selected. *op* specifies how the original permission *p* is to be modified:

**+**

**|** the new bits are set in *p*;

**-**

the new bits are cleared in *p*;

**&**

the new bits are and'd with *p*;

**=**

the select bits in *p* are set equal to the new bits

A permission expression term may also be an octal number. Octal specifications are inherently non-portable. Refer to [*chmod*(1)](/man/os/ksh/chmod.1) for an explanation of this form.

# [SEE ALSO](#SEE_ALSO)

[chmod(1)](/man/os/ksh/chmod.1), [ls(1)](/man/os/ksh/ls.1), [strmode(3)](/man/os/ksh/strmode.3)

---

Document: strperm(3ast) from ksh 1.0.10-r36 (Chainguard OS)
Source: https://github.com/ksh93/ksh
