extar 0.1.1

Out-of-core tar archive processing.
Documentation
  • Coverage
  • 26.67%
    4 out of 15 items documented0 out of 9 items with examples
  • Size
  • Source code size: 7.66 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.48 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • peterhj/extar
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • peterhj

extar

extar is a simple library for reading tar archives. Its intended usage is for out-of-core or external processing, where it is advisable to seek as much as possible to avoid reading and paging.

BufferedTarFile currently exposes one iterator, RawTarEntries. As its name suggests, it yields the bare minimum information that the application may find useful: the header offset, the filename, the file offset, and the file size. The application is responsible for actually reading the file.

extern crate extar;

use extar::*;
use std::fs::{File};
use std::path::{PathBuf};

fn main() {
  let path = PathBuf::new("ILSVRC2012_img_train.tar");
  let file = File::open(&path).unwrap();
  let mut tar = BufferedTarFile::new(file);
  let file_count = tar.raw_entries().count();
  assert_eq!(file_count, 1000);
}