MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / try_clone_file

Function try_clone_file

crates/openshell-driver-vm/src/rootfs.rs:201–217  ·  view source on GitHub ↗
(source: &Path, dest: &Path)

Source from the content-addressed store, hash-verified

199
200#[cfg(target_os = "macos")]
201fn try_clone_file(source: &Path, dest: &Path) -> Result<(), String> {
202 let output = Command::new("cp")
203 .arg("-c")
204 .arg(source)
205 .arg(dest)
206 .output()
207 .map_err(|e| format!("run cp -c: {e}"))?;
208 if output.status.success() {
209 return Ok(());
210 }
211 Err(format!(
212 "cp -c failed with status {}\nstdout: {}\nstderr: {}",
213 output.status,
214 String::from_utf8_lossy(&output.stdout),
215 String::from_utf8_lossy(&output.stderr)
216 ))
217}
218
219#[cfg(target_os = "linux")]
220fn try_clone_file(source: &Path, dest: &Path) -> Result<(), String> {

Callers 1

Calls 1

successMethod · 0.45

Tested by

no test coverage detected