package tar

  1. Overview
  2. Docs
Decode and encode tar format files in pure OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

tar-mirage-2.0.1.tbz
sha256=e9565fb43dab9e944d1860f9a3b5c681df72211b859c66ee1d7085cafc13ee9b
sha512=e4486274b44e6b34540afc9893bc0f2b604ba01c576b01aeb0b494f30791a0c353d1809de62e2f0ae04de771a2391affb17b98b1fc6c0d2fc2e963741bc65a55

Description

tar is a simple library to read and write tar files with an emphasis on streaming.

This is pure OCaml code, no C bindings.

Tags

org:xapi-project org:mirage

Published: 09 Mar 2022

README

tar -- decode and encode tar files

tar is a simple library to read and write tar files with an emphasis on streaming.

This is pure OCaml code, no C bindings.

Installation

tar can be installed with opam:

opam install tar
opam install tar-unix    # for use in Unix/Lwt
opam install tar-mirage  # for use in MirageOS

If you don't use opam consult the tar.opam file for build instructions.

Example toplevel session

In utop:

utop # #require "tar";;
utop # #require "tar-unix";;

utop # let f = Lwt_unix.openfile "/tmp/foo.tar" [ Unix.O_RDONLY ] 0;;
val f : Lwt_unix.file_descr = <abstr>

utop # Lwt.bind f Tar_lwt_unix.Archive.list;;
[{Tar.Header.file_name = "_build/lib/tar.mli.depends";
  Tar.Header.file_mode = 420; Tar.Header.user_id = 1000;
  Tar.Header.group_id = 1000; Tar.Header.file_size = 21L;
  Tar.Header.mod_time = 1381080315L;
  Tar.Header.link_indicator = Tar.Header.Link.Normal;
  Tar.Header.link_name = ""};
 {Tar.Header.file_name = "_build/lib/tar_unix.mli.depends";
  Tar.Header.file_mode = 420; Tar.Header.user_id = 1000;
  Tar.Header.group_id = 1000; Tar.Header.file_size = 27L;
  Tar.Header.mod_time = 1381080318L;
  Tar.Header.link_indicator = Tar.Header.Link.Normal;
  Tar.Header.link_name = ""};
 {Tar.Header.file_name = "_build/lib/tar.mllib";
  Tar.Header.file_mode = ...; Tar.Header.user_id = ...;
  Tar.Header.group_id = ...; Tar.Header.file_size = ...;
  Tar.Header.mod_time = ...; Tar.Header.link_indicator = ...;
  Tar.Header.link_name = ...};
 ...]

Example users

This library is used by

  • xapi to read and write VM images

Documentation

The documentation and API reference is automatically generated by ocamldoc from the interfaces. It can be consulted online.

Dependencies (6)

  1. re >= "1.7.2"
  2. cstruct >= "6.0.0"
  3. ppx_cstruct build & >= "3.6.0"
  4. ocaml >= "4.08.0"
  5. camlp-streams
  6. dune >= "2.9"

Dev Dependencies (1)

  1. odoc with-doc

Used by (6)

  1. octez-shell-libs
  2. octez-smart-rollup-node-lib >= "19.0"
  3. tar-mirage = "2.0.1"
  4. tar-unix < "1.0.1" | = "2.0.1"
  5. tezos-store >= "13.0"
  6. vpnkit >= "0.1.1"

Conflicts

None