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

56 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[fs.op.permissions]
# 31 Input/output library [[input.output]](./#input.output)
## 31.12 File systems [[filesystems]](filesystems#fs.op.permissions)
### 31.12.13 Filesystem operation functions [[fs.op.funcs]](fs.op.funcs#fs.op.permissions)
#### 31.12.13.27 Permissions [fs.op.permissions]
[🔗](#lib: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](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L18294)
*Preconditions*: Exactly one of the perm_options constantsreplace, add, or remove is present in opts[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L18299)
*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[.](#2.sentence-1)
The action is applied as if by POSIX fchmodat[.](#2.sentence-2)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L18307)
[*Note [1](#note-1)*:
Conceptually permissions are viewed as bits, but the actual
implementation can use some other mechanism[.](#3.sentence-1)
— *end note*]
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L18313)
*Throws*: As specified in [[fs.err.report]](fs.err.report "31.12.5Error reporting")[.](#4.sentence-1)
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L18317)
*Remarks*: The second signature behaves as if it had an additional parameterperm_options opts with an argument of perm_options::replace[.](#5.sentence-1)