package tar-mirage

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

Install

Dune Dependency

Authors

Maintainers

Sources

tar-v1.1.0.tbz
sha256=c48e4ce128058fac4ae1a0f3d2d49f42d9a736a3bf166b59f086e6e6f926018d
sha512=ea273a8fefab42624c42da9d1a02557d1c51d4d8c0d032e8d8a17e0f6866c56b3ab0b32eacb8ad788bbf6983bff36ac072353af08a730b6b26f9c45d4d4f521a

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: 09 Apr 2019

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.lwt";;

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

utop # Tar_lwt_unix.Archive.list f;;
[{Tar_lwt_unix.Header.file_name = "_build/lib/tar.mli.depends";
  Tar_lwt_unix.Header.file_mode = 420; Tar_lwt_unix.Header.user_id = 1000;
  Tar_lwt_unix.Header.group_id = 1000; Tar_lwt_unix.Header.file_size = 21L;
  Tar_lwt_unix.Header.mod_time = 1381080315L;
  Tar_lwt_unix.Header.link_indicator = Tar_lwt_unix.Header.Link.Normal;
  Tar_lwt_unix.Header.link_name = ""};
 {Tar_lwt_unix.Header.file_name = "_build/lib/tar_unix.mli.depends";
  Tar_lwt_unix.Header.file_mode = 420; Tar_lwt_unix.Header.user_id = 1000;
  Tar_lwt_unix.Header.group_id = 1000; Tar_lwt_unix.Header.file_size = 27L;
  Tar_lwt_unix.Header.mod_time = 1381080318L;
  Tar_lwt_unix.Header.link_indicator = Tar_lwt_unix.Header.Link.Normal;
  Tar_lwt_unix.Header.link_name = ""};
 {Tar_lwt_unix.Header.file_name = "_build/lib/tar.mllib";
  Tar_lwt_unix.Header.file_mode = ...; Tar_lwt_unix.Header.user_id = ...;
  Tar_lwt_unix.Header.group_id = ...; Tar_lwt_unix.Header.file_size = ...;
  Tar_lwt_unix.Header.mod_time = ...; Tar_lwt_unix.Header.link_indicator = ...;
  Tar_lwt_unix.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 (12)

  1. ptime
  2. io-page
  3. lwt
  4. mirage-kv-lwt >= "2.0.0"
  5. mirage-kv >= "2.0.0" & < "3.0.0"
  6. mirage-block-lwt
  7. mirage-block < "2.0.0"
  8. re >= "1.7.2"
  9. cstruct >= "1.9.0"
  10. tar >= "1.0.0" & < "2.0.0"
  11. dune >= "1.0"
  12. ocaml >= "4.05.0" & < "4.13"

Dev Dependencies (4)

  1. tar-unix with-test
  2. ounit with-test
  3. io-page-unix with-test
  4. mirage-block-unix with-test & >= "2.5.0"

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.