ephemeral-dir
Overview
The EphemeralDir struct allows you to create temporary directory that is automatically cleaned up (deleted) when the EphemeralDir instance goes out of scope. This is useful for tests or temporary file operations.
Why not tempfile?
tempfile, should be preferred as it is more complete. The reason for ephemeral_dir to exist is that I wanted to have temporary directory with a fixed name (without any random bytes in the name).
Usage
Use EphemeralDir::new(<path>) to create an ephemeral dir -- this would panic if the directory at <path> already exists.
Use EphemeralDir::new_forced(<path>) to create an ephemeral dir, deleting the existing directory at <path>.
use EphemeralDir;
use Path;