Giter Site home page Giter Site logo

kinrany / cachedir Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jstasiak/cachedir

0.0 0.0 0.0 41 KB

A Rust library to help interacting with cache directories and CACHEDIR.TAG files as defined in Cache Directory Tagging Specification (https://bford.info/cachedir/).

Rust 100.00%

cachedir's Introduction

cachedir

crates.io CI codecov

A Rust library and a CLI tool to help interacting with cache directories and CACHEDIR.TAG files as defined in Cache Directory Tagging Specification.

You can find the library documentation on docs.rs.

To install the CLI tool run cargo install cachedir. To see what options are available run cachedir --help. Only one subcommand, is-tagged, is implemented right now. It allows checking if a directory is tagged with CACHEDIR.TAG (prints the relevant information to stderr and sets an appropriate exit-code: 0 for true, 1 for false, 2 for an error):

~/projects/cachedir% ls -lah target 
total 16
drwxr-xr-x@  6 user  staff   192B Dec 10 17:02 ./
drwxr-xr-x  10 user  staff   320B Dec 10 17:16 ../
-rw-r--r--   1 user  staff   1.4K Dec 12 21:52 .rustc_info.json
-rw-r--r--   1 user  staff   177B Dec 10 15:52 CACHEDIR.TAG
drwxr-xr-x  13 user  staff   416B Dec 12 21:47 debug/
drwxr-xr-x@  5 user  staff   160B Dec 10 17:02 rls/

~/projects/cachedir% cat target/CACHEDIR.TAG 
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by cargo.
# For information about cache directory tags see https://bford.info/cachedir/


~/projects/cachedir% cachedir is-tagged does-not-exist
No such file or directory (os error 2)
% echo $?
2

~/projects/cachedir% cachedir is-tagged .             
. is not tagged with CACHEDIR.TAG
~/projects/cachedir% echo $?                                 
1

~/projects/cachedir% cachedir is-tagged target
target is tagged with CACHEDIR.TAG
~/projects/cachedir% echo $?
0

Versions 0.1.0 and 0.1.1 of this crate on crates.io are actually distributions of a different, abandonded project by Lilian Anatolie Moraru. Credits to Lilian for transferring the name to me.

cachedir's People

Contributors

jstasiak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.