an efficient binary archive format
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

readme

zach 14d0f1e7 c184f7c1

+41 -2
+41 -2
README.md
··· 1 1 # bindle-file 2 2 3 - [bindle](https://en.wikipedia.org/wiki/Bindle) is a general purpose binary archive 4 - format for collecting files. 3 + [bindle](https://en.wikipedia.org/wiki/Bindle) is a general purpose binary archive format for collecting files. 4 + 5 + The format uses memory-mapped I/O for fast reads, optional zstd compression, and supports append-only writes with shadowing for updates. Files can be added incrementally without rewriting the entire archive. 6 + 7 + ## Usage 8 + 9 + ```rust 10 + use bindle_file::{Bindle, Compress}; 11 + 12 + // Create or open an archive 13 + let mut archive = Bindle::open("data.bndl")?; 14 + 15 + // Add files 16 + archive.add("config.json", data, Compress::None)?; 17 + archive.save()?; 18 + 19 + // Read files 20 + let data = archive.read("config.json").unwrap(); 21 + 22 + // Update by shadowing (old data remains until vacuum) 23 + archive.add("config.json", new_data, Compress::None)?; 24 + archive.save()?; 25 + 26 + // Reclaim space from shadowed entries 27 + archive.vacuum()?; 28 + ``` 29 + 30 + ## CLI 31 + 32 + The `bindle` command provides basic operations: 33 + 34 + ```bash 35 + bindle add archive.bndl file.txt 36 + bindle read archive.bndl file.txt 37 + bindle list archive.bndl 38 + bindle vacuum archive.bndl 39 + ``` 40 + 41 + ## Format 42 + 43 + See [SPEC.md](SPEC.md) for the binary format specification.