use std::fs;
use std::path::Path;
use uucore::translate;
#[cfg(any(unix, target_os = "redox"))]
pub fn chmod(path: &Path, mode: u32) -> Result<(), ()> {
use std::os::unix::fs::PermissionsExt;
use uucore::{display::Quotable, show_error};
fs::set_permissions(path, fs::Permissions::from_mode(mode)).map_err(|err| {
show_error!(
"{}",
translate!("install-error-chmod-failed-detailed", "path" => path.maybe_quote(), "error" => err)
);
})
}
#[cfg(windows)]
pub fn chmod(path: &Path, mode: u32) -> Result<(), ()> {
Ok(())
}