MCPcopy Create free account
hub / github.com/KCORES/vector-db-bench / copy_dir_recursive

Function copy_dir_recursive

agent/src/tools.rs:361–374  ·  view source on GitHub ↗

Recursively copy a directory.

(src: &std::path::Path, dst: &std::path::Path)

Source from the content-addressed store, hash-verified

359
360/// Recursively copy a directory.
361fn copy_dir_recursive(src: &std::path::Path, dst: &std::path::Path) -> std::io::Result<()> {
362 std::fs::create_dir_all(dst)?;
363 for entry in std::fs::read_dir(src)? {
364 let entry = entry?;
365 let ty = entry.file_type()?;
366 let dst_path = dst.join(entry.file_name());
367 if ty.is_dir() {
368 copy_dir_recursive(&entry.path(), &dst_path)?;
369 } else {
370 std::fs::copy(entry.path(), &dst_path)?;
371 }
372 }
373 Ok(())
374}
375
376// ─── Tests ───────────────────────────────────────────────────────────────────
377

Callers 1

dispatch_tool_callFunction · 0.85

Calls 1

pathMethod · 0.80

Tested by

no test coverage detected