an efficient binary archive format
0
fork

Configure Feed

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

C 45.3%
Rust 41.4%
Python 7.2%
C++ 5.5%
Makefile 0.7%
51 1 2

Clone this repository

https://tangled.org/zachshipko.com/bindle-file https://tangled.org/did:plc:gvjre7emtreh5bdqtfwle6j2/bindle-file
git@tangled.org:zachshipko.com/bindle-file git@tangled.org:did:plc:gvjre7emtreh5bdqtfwle6j2/bindle-file

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

bindle-file#

bindle is a fast/efficient, binary archive format.

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.

Installation#

The CLI can be installed by running:

cargo install bindle-file

Rust#

use bindle_file::{Bindle, Compress};

// Create or open an archive
let mut archive = Bindle::open("data.bndl")?;

// Add files
archive.add("config.json", data, Compress::None)?;
archive.save()?;

// Read files
let data = archive.read("config.json").unwrap();

// Update by shadowing (old data remains until vacuum)
archive.add("config.json", new_data, Compress::None)?;
archive.save()?;

// Reclaim space from shadowed entries
archive.vacuum()?;

C#

#include "bindle.h"

Bindle* bindle = bindle_open("data.bndl");
bindle_add(bindle, "file.txt", data, len, BindleCompressNone);
bindle_save(bindle);

size_t size;
uint8_t* data = bindle_read(bindle, "file.txt", &size);

// Or for uncompressed entries, read directly without decompression
uint8_t* raw = bindle_read_uncompressed_direct(bindle, "file.txt", &size);

free(data);
bindle_close(bindle);

Run:

make build

To build libbindle and copy in to the root of repository

CLI#

The bindle command provides basic operations:

bindle add archive.bndl file.txt
bindle cat archive.bndl file.txt
bindle pack archive.bndl /some/dir
bindle unpack archive.bndl /unpack/to/dir
bindle list archive.bndl
bindle vacuum archive.bndl

Format#

See SPEC.md for the binary format specification.