package tar-mirage

  1. Overview
  2. Docs
Decode and encode tar formatted streams

Install

Dune Dependency

Authors

Maintainers

Sources

v0.8.0.tar.gz
sha256=2c2c21a40f2653bf60c05e96803de87903c6a9935f4d917137031c8b602d81e5
md5=bf7aefc14b7454a6e73be2fb47e6edd8

Description

This is a simple library to read and write tar formatted streams from Mirage applications.

Tags

org:xapi-project org:mirage

Published: 09 May 2017

README

tar-format -- decode and encode tar files

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

This is pure OCaml code, no C bindings.

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

Installation

tar-format can be installed with opam:

opam install tar-format

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

Documentation

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

Dependencies (9)

  1. lwt
  2. mirage-types-lwt >= "3.0.0" & < "3.7.0"
  3. result
  4. re
  5. cstruct >= "1.9.0"
  6. tar < "1.0.0"
  7. ocamlfind build
  8. jbuilder
  9. ocaml >= "4.01.0" & < "4.06.0"

Dev Dependencies (2)

  1. ounit with-test
  2. mirage-block-unix with-test & >= "2.5.0"

Used by

None

Conflicts (2)

  1. mirage-kv >= "2.0.0"
  2. mirage-types-lwt < "3.0.0"
OCaml

Innovation. Community. Security.