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

Function chown_path

src/main.rs:336–356  ·  view source on GitHub ↗
(path: &Path, owner_spec: &str, recursive: bool)

Source from the content-addressed store, hash-verified

334}
335
336fn chown_path(path: &Path, owner_spec: &str, recursive: bool) -> Result<(), Box<dyn Error>> {
337 let mut command = std::process::Command::new("chown");
338 if recursive {
339 command.arg("-R");
340 }
341 let path_arg = path.to_string_lossy().into_owned();
342 command.args([owner_spec, path_arg.as_str()]);
343 let output = command.output()?;
344 if output.status.success() {
345 return Ok(());
346 }
347
348 Err(format!(
349 "chown failed for '{}' with owner '{}': status={}, stderr={}",
350 path.display(),
351 owner_spec,
352 output.status,
353 String::from_utf8_lossy(&output.stderr).trim()
354 )
355 .into())
356}
357
358fn align_owner_with_openclaw_path(
359 path: &Path,

Callers 2

Calls 1

as_strMethod · 0.80

Tested by

no test coverage detected