Files
cppdraft_translate/cppdraft/fs/op/permissions.md
2025-10-25 03:02:53 +03:00

2.0 KiB
Raw Permalink Blame History

[fs.op.permissions]

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);

1

#

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

2

#

Effects: Applies the action specified by opts to 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.

3

#

[Note 1:

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

— end note]

4

#

Throws: As specified in [fs.err.report].

5

#

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