Scroll to navigation

STRPERM(3) Library Functions Manual STRPERM(3)

NAME

strperm - evaluate file permission expression

SYNOPSIS

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:

the user permission bits;
the group permission bits;
the `other' permission bits;
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) for an explanation of this form.

SEE ALSO

chmod(1), ls(1), strmode(3)