---
name: "strperm"
section: "3"
platform: "macos"
package: "ksh"
version: "42"
release: "macOS 26.5"
platforms: ["macos"]
url: "https://new.carta.tech/strperm"
---

# strperm(3)

evaluate file permission expression

## NAME

strperm - evaluate file permission expression

## SYNOPSIS

$1$2int strperm(char\* s, char\*\* e, int p)int strperm(char\* s, char\*\* e, int p)int strperm(char\* s, char\*\* e, int p)int strperm(char\* s, char\*\* e, int p)int strperm(char\* s, char\*\* e, int p)int strperm(char\* s, char\*\* e, int p)int strperm(char\* s, char\*\* e, int p)int strperm(char\* s, char\*\* e, int p)

## DESCRIPTION

*strperm* applies a file permission expression in the nul-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**

  the user permission bits;

- **g**

  the group permission bits;

- **o**

  the \`other' permission bits;

- **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)](/chmod/1.md) for an explanation of this form.

## SEE ALSO

[chmod(1)](/chmod/1.md), [ls(1)](/ls/1.md), [strmode(3)](/strmode/3.md)
