[fs.op.permissions] (original) (raw)

31 Input/output library [input.output]

31.12 File systems [filesystems]

31.12.13 Filesystem operation functions [fs.op.funcs]

31.12.13.27 Permissions [fs.op.permissions]

void filesystem::permissions(const path& p, perms prms, perm_options opts=perm_options::replace);void filesystem::permissions(const path& p, perms prms, error_code& ec) noexcept;void filesystem::permissions(const path& p, perms prms, perm_options opts, error_code& ec);

Preconditions: Exactly one of the perm_options constantsreplace, add, or remove is present in opts.

Effects: Applies the action specified by optsto the file p resolves to, or to file p itself if p is a symbolic link and perm_options​::​nofollow is set in opts.

The action is applied as if by POSIX fchmodat.

[Note 1:

Conceptually permissions are viewed as bits, but the actual implementation can use some other mechanism.

— _end note_]

Remarks: The second signature behaves as if it had an additional parameterperm_options opts with an argument of perm_options​::​replace.