Skip to content

Copies the currently running program into a temporary location

License

Notifications You must be signed in to change notification settings

cmeister2/replicate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Copies the currently running program into a temporary location

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages