copy_from_cache

Function copy_from_cache 

Source
pub fn copy_from_cache(
    source: &Utf8Path,
    target: &Utf8Path,
) -> BootstrapResult<()>
Expand description

Copies cached binaries to the target installation directory.

Performs a recursive copy of the source directory contents to the target, preserving directory structure and file permissions.

§Arguments

  • source - Source directory containing cached binaries
  • target - Target installation directory

§Errors

Returns an error if:

  • The source directory does not exist or cannot be read
  • The target directory cannot be created
  • Any file copy operation fails

§Examples

use camino::Utf8Path;
use pg_embedded_setup_unpriv::cache::copy_from_cache;

let source = Utf8Path::new("/home/user/.cache/pg-embedded/binaries/17.4.0");
let target = Utf8Path::new("/tmp/sandbox/install");
copy_from_cache(source, target)?;