Skip to content

Commit fdf8ab6

Browse files
committed
unistd: add docs for chown
Signed-off-by: Paul Osborne <osbpau@gmail.com>
1 parent fd1f44e commit fdf8ab6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/unistd.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,17 @@ pub fn getcwd() -> Result<PathBuf> {
305305
}
306306
}
307307

308+
/// Change the ownership of the file at `path` to be owned by the specified
309+
/// `owner` (user) and `group` (see
310+
/// [chown(2)](http://man7.org/linux/man-pages/man2/lchown.2.html)).
311+
///
312+
/// The owner/group for the provided path name will not be modified if `None` is
313+
/// provided for that argument. Ownership change will be attempted for the path
314+
/// only if `Some` owner/group is provided.
315+
///
316+
/// This call may fail under a number of different situations. See [the man
317+
/// pages](http://man7.org/linux/man-pages/man2/lchown.2.html#ERRORS) for
318+
/// additional details.
308319
#[inline]
309320
pub fn chown<P: ?Sized + NixPath>(path: &P, owner: Option<uid_t>, group: Option<gid_t>) -> Result<()> {
310321
let res = try!(path.with_nix_path(|cstr| {

0 commit comments

Comments
 (0)