Function self_replace::self_delete

source ·
pub fn self_delete() -> Result<(), Error>
Expand description

Deletes the executable in a platform independent manner.

The deletion on windows is delayed until the process shuts down. For updating instead of deleting, use self_replace instead. Not that you must only only call this function once during the execution of the program and you should exist quickly afterwards to make the delete take effect on Windows.

self_replace::self_delete()?;