package tar-mirage

  1. Overview
  2. Docs
Read and write tar format files via MirageOS interfaces

Install

Dune Dependency

Authors

Maintainers

Sources

tar-2.6.0.tbz
sha256=caff0cb7046343e2bff7fc0f9217e4e31235555e4c4889fb194792985b6fb1ee
sha512=61cedd25de48cfa8092b4e03e275139ff27aa36f3e24f936bc90e2974e3c52b2460db214b3f8480c6d45bbc59bf2232623dd840b4ce445077393a71e0d005903

Description

tar is a simple library to read and write tar files with an emphasis on streaming. This library is functorised over external OS dependencies to facilitate embedding within MirageOS.

Tags

org:xapi-project org:mirage

Published: 07 Sep 2023

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 = ...};
 ...]

Compressed tarball

The distribution gives a small implementation to create a tarball, a compressed archive. The software allows to list the contents of a given tarball. The compression is done with decompress. You can look at the project documentation for more information on how to compress.

Alternatively, it is possible to use the Tar_gz module which offers the same interface as Tar with compression.

Example users

This library is used by

  • xapi to read and write VM images;

  • obuilder to copy files extensively.

Documentation

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

Dependencies (10)

  1. tar = version
  2. ptime
  3. optint
  4. mirage-kv >= "6.0.0"
  5. mirage-clock >= "4.0.0"
  6. mirage-block >= "2.0.0"
  7. lwt >= "5.6.0"
  8. cstruct >= "1.9.0"
  9. ocaml >= "4.08.0"
  10. dune >= "2.9"

Dev Dependencies (6)

  1. odoc with-doc
  2. tar-unix with-test & = version
  3. alcotest-lwt >= "1.7.0" & with-test
  4. alcotest >= "1.7.0" & with-test
  5. mirage-clock-unix with-test & >= "4.0.0"
  6. mirage-block-unix with-test & >= "2.13.0"

Used by

None

Conflicts (1)

  1. result < "1.5"
OCaml

Innovation. Community. Security.