pub fn install(
bytes: &[u8],
exe: &Path,
replace: impl FnOnce(&Path) -> Result<()>,
) -> Result<()>Expand description
Write bytes beside exe and hand the new file to replace, which puts it in exe’s
place. The staging file is removed afterwards, whatever replace did.
The staging file is in exe’s directory so the replacement is a rename on one file
system, never a half-written executable.