| Crates.io | mortem |
| lib.rs | mortem |
| version | 0.3.0 |
| created_at | 2022-02-25 21:21:55.618499+00 |
| updated_at | 2022-07-21 17:50:51.638394+00 |
| description | Easy self-deleting executables |
| homepage | https://docs.rs/mortem |
| repository | https://github.com/mibmo/mortem |
| max_upload_size | |
| id | 539669 |
| size | 25,386 |
Easy self-deleting executables.
Simply register a guard (either soft or hard) in the program entrypoint, and have it be dropped to delete the binary.
fn main() {
let _mortem = mortem::hard(); // register mortem guard
// some code
println!("Hello!")
// _mortem drops and executable is deleted
}
soft and hard?The soft handler exits on IO errors and only tries to delete the executable once;
the hard handler keeps trying till the executable is successfully deleted.
This is explained in further details in the documentation.
Tracing is disabled by default, but can be enabled with the tracing feature.
See the examples directory or documentation.