56 lines
2.0 KiB
Markdown
56 lines
2.0 KiB
Markdown
[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.5 Error 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)
|