(path: &Path, mode_bits: u32)
| 193 | } |
| 194 | |
| 195 | pub fn set_mode(path: &Path, mode_bits: u32) -> Result<(), Error> { |
| 196 | let mode_str = format_octal_mode(mode_bits); |
| 197 | let path_arg = path.to_string_lossy().into_owned(); |
| 198 | let mut command = Command::new("chmod"); |
| 199 | command.args([mode_str.as_str(), path_arg.as_str()]); |
| 200 | command_status(&mut command, "chmod") |
| 201 | } |
| 202 | |
| 203 | #[cfg(test)] |
| 204 | mod tests { |
no test coverage detected