MCPcopy Create free account
hub / github.com/clawshell/clawshell / set_mode

Function set_mode

src/platform/linux.rs:195–201  ·  view source on GitHub ↗
(path: &Path, mode_bits: u32)

Source from the content-addressed store, hash-verified

193}
194
195pub 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)]
204mod tests {

Callers 1

cmd_onboardFunction · 0.50

Calls 3

format_octal_modeFunction · 0.85
command_statusFunction · 0.85
as_strMethod · 0.80

Tested by

no test coverage detected