From f287309b72ff61b132af50179e7d9c394bfd4e02 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 12 Dec 2020 14:43:56 +0100 Subject: [PATCH] perms: add some docs --- src/uucore/src/lib/features/perms.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/uucore/src/lib/features/perms.rs b/src/uucore/src/lib/features/perms.rs index bbe53ac2a..66db15451 100644 --- a/src/uucore/src/lib/features/perms.rs +++ b/src/uucore/src/lib/features/perms.rs @@ -16,6 +16,7 @@ use std::os::unix::fs::MetadataExt; use std::os::unix::ffi::OsStrExt; use std::path::Path; +/// The various level of verbosity #[derive(PartialEq, Clone, Debug)] pub enum Verbosity { Silent, @@ -24,6 +25,7 @@ pub enum Verbosity { Normal, } +/// Actually perform the change of group on a path fn chgrp>(path: P, dgid: gid_t, follow: bool) -> IOResult<()> { let path = path.as_ref(); let s = CString::new(path.as_os_str().as_bytes()).unwrap(); @@ -41,6 +43,9 @@ fn chgrp>(path: P, dgid: gid_t, follow: bool) -> IOResult<()> { } } +/// Perform the change of group on a path +/// with the various options +/// and error messages management pub fn wrap_chgrp>( path: P, meta: &Metadata, @@ -94,6 +99,7 @@ pub fn wrap_chgrp>( Ok(out) } +/// Actually perform the change of owner on a path fn chown>(path: P, duid: uid_t, dgid: gid_t, follow: bool) -> IOResult<()> { let path = path.as_ref(); let s = CString::new(path.as_os_str().as_bytes()).unwrap(); @@ -111,6 +117,9 @@ fn chown>(path: P, duid: uid_t, dgid: gid_t, follow: bool) -> IOR } } +/// Perform the change of owner on a path +/// with the various options +/// and error messages management pub fn wrap_chown>( path: P, meta: &Metadata,