[−][src]Crate cachedir
A Rust library to help interacting with cache directories and CACHEDIR.TAG
files as defined
in Cache Directory Tagging Specification.
The abstract of the spefication should be more than enough to illustrate what we're doing here:
Many applications create and manage directories containing cached information about content stored elsewhere, such as cached Web content or thumbnail-size versions of images or movies. For speed and storage efficiency we would often like to avoid backing up, archiving, or otherwise unnecessarily copying such directories around, but it is a pain to identify and individually exclude each such directory during data transfer operations. I propose an extremely simple convention by which applications can reliably "tag" any cache directories they create, for easy identification by backup systems and other data management utilities. Data management utilities can then heed or ignore these tags as the user sees fit.
Enums
TagState | The state of a |
Constants
HEADER | The |
Functions
add_tag | Adds a tag to the specified |
ensure_tag | Ensures the tag exists in |
get_tag_state | Gets the state of the tag in the specified directory. |
is_tagged | Returns |
mkdir_atomic | Tries to create |