#filesystem #data-structures

archivist

Store files in a time or index based directory hierarchy, automatically deleting the oldest files if the size limit is reached

5 releases

0.1.1 May 16, 2024
0.1.0 May 16, 2024
0.0.3 May 16, 2024
0.0.0 Aug 30, 2019

#351 in Database interfaces

Download history 15/week @ 2024-02-18 9/week @ 2024-03-10 4/week @ 2024-03-31 311/week @ 2024-05-12 51/week @ 2024-05-19

362 downloads per month

MIT license

1MB
272 lines

Archivist

Crates.io Version Crates.io License docs.rs

Store files in a time or index based directory hierarchy, automatically deleting the oldest files if the size limit is reached.

It's using an efficient kv-store database for persistency and performance reasons.

    // Store at max 1GB of files
    let mut a = Archivist::new("/tmp/archive", DateTimeTree::default(), 1000).await?;
   
    // Our humble file that we want to keep, but may lose interest after some time 
    let mut f = fs::File::open("/tmp/my_words.txt").unwrap();

    // crate a store object for file compression
    let ss = GzStore::new(Cursor::new(f.clone()));

    // add the file to the archive
    a.add("words.txt.gz", &ss).await?;

Copyright 2022-2024, Falco Hirschenberger falco.hirschenberger@gmail.com

Dependencies

~19–27MB
~209K SLoC