replicate

Crates.ioreplicate
lib.rsreplicate
version0.1.1
sourcesrc
created_at2022-11-11 23:23:05.939871
updated_at2022-11-12 16:57:48.557573
descriptionCopies the currently running program into a temporary location
homepage
repositoryhttps://github.com/cmeister2/replicate
max_upload_size
id713173
size19,726
Max Dymond (cmeister2)

documentation

README

replicate

replicate is a library that:

  • copies the currently running program to a temporary file
  • (Unix-only) makes that file executable
  • returns a path object to the temporary file, that cleans up the temporary file when dropped.

It's intended to be used by musl-compiled programs which can run inside Docker containers; by creating a copy and then volume-mounting that program within the Docker container.

Examples

use replicate::Replicate;

fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
    let copy = Replicate::new()?;
    println!("My copy's path is {}", copy.display());
    Ok(())
}

Additional examples are in the examples directory.

Commit count: 6

cargo fmt