Skip to main content

cleanup_stale_old_binary

Function cleanup_stale_old_binary 

Source
pub fn cleanup_stale_old_binary()
Expand description

Best-effort cleanup of a leftover <current_exe>.old from a prior Windows self-update.

On Windows, manual or recovery scenarios may leave a seshat.exe.old next to the running seshat.exe (the happy-path self_replace::self_replace flow already schedules its own relocated-binary deletion via the crate’s .__selfdelete__.exe helper, so this is purely defensive). Errors are silently dropped — cleanup must never fail the user’s command.

On Unix this is a no-op: atomic rename(2) semantics in replace_binary never leave a .old file behind, so there is nothing to probe for.