Skip to main content

swap_binary

Function swap_binary 

Source
pub fn swap_binary(binary_path: &Path, new_data: &[u8]) -> Result<()>
Expand description

Swap the old binary with the new one.

  1. Rename the current binary to a .old temporary file
  2. Write the new binary to the original path
  3. Set executable permissions
  4. Remove the .old temporary file