MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / create_tar_archive_from_directory

Method create_tar_archive_from_directory

src/docker/proxy_manager.rs:715–729  ·  view source on GitHub ↗

Creates a tar archive from a directory

(&self, dir_path: &Path)

Source from the content-addressed store, hash-verified

713
714 /// Creates a tar archive from a directory
715 fn create_tar_archive_from_directory(&self, dir_path: &Path) -> Result<Vec<u8>> {
716 use tar::Builder;
717
718 let mut tar_data = Vec::new();
719 {
720 let mut builder = Builder::new(&mut tar_data);
721
722 // Add all files from the directory to the tar archive
723 builder.append_dir_all(".", dir_path)?;
724
725 builder.finish()?;
726 }
727
728 Ok(tar_data)
729 }
730
731 /// Creates an internal network for a specific agent container.
732 ///

Callers 1

build_proxyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected