It's pretty neat, especially for things like this. 

It creates an `at_exit` hook to clean up whatever file is created.