MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / cp_r

Function cp_r

tests/wasi.rs:257–270  ·  view source on GitHub ↗
(path: &Path, dst: &Path)

Source from the content-addressed store, hash-verified

255}
256
257fn cp_r(path: &Path, dst: &Path) -> Result<()> {
258 fs::create_dir(dst)?;
259 for entry in path.read_dir()? {
260 let entry = entry?;
261 let path = entry.path();
262 let dst = dst.join(entry.file_name());
263 if entry.file_type()?.is_dir() {
264 cp_r(&path, &dst)?;
265 } else {
266 fs::copy(&path, &dst)?;
267 }
268 }
269 Ok(())
270}
271
272#[derive(Debug, Default, Deserialize)]
273struct Spec {

Callers 1

run_testFunction · 0.85

Calls 5

OkFunction · 0.85
file_nameMethod · 0.80
is_dirMethod · 0.80
pathMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected