MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / write_materialized_files

Method write_materialized_files

atomic-repository/src/repository/sandbox.rs:467–480  ·  view source on GitHub ↗
(
        dir: &Path,
        files: &BTreeMap<String, Vec<u8>>,
    )

Source from the content-addressed store, hash-verified

465 }
466
467 fn write_materialized_files(
468 dir: &Path,
469 files: &BTreeMap<String, Vec<u8>>,
470 ) -> Result<(), RepositoryError> {
471 std::fs::create_dir_all(dir)?;
472 for (path, bytes) in files {
473 let target = dir.join(path);
474 if let Some(parent) = target.parent() {
475 std::fs::create_dir_all(parent)?;
476 }
477 std::fs::write(target, bytes)?;
478 }
479 Ok(())
480 }
481
482 /// Materialize a view's visible file content into `dir` (created if needed).
483 ///

Callers

nothing calls this directly

Calls 2

parentMethod · 0.80
writeFunction · 0.50

Tested by

no test coverage detected