package tar-unix

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Utility functions for operating over whole tar archives

val with_next_file : Lwt_unix.file_descr -> (Lwt_unix.file_descr -> Tar.Header.t -> 'a Lwt.t) -> 'a option Lwt.t

Read the next header, apply the function 'f' to the fd and the header. The function should leave the fd positioned immediately after the datablock. Finally the function skips past the zero padding to the next header.

val list : ?level:Tar.Header.compatibility -> Lwt_unix.file_descr -> Tar.Header.t list Lwt.t

List the contents of a tar to stdout.

val extract : (string -> string) -> Lwt_unix.file_descr -> unit Lwt.t

extract dest extract the contents of a tar. Apply dest on each source filename to change the destination filename. It only supports extracting regular files from the top-level of the archive.

val transform : ?level:Tar.Header.compatibility -> (Tar.Header.t -> Tar.Header.t) -> Lwt_unix.file_descr -> Lwt_unix.file_descr -> unit Lwt.t

transform f in_fd out_fd applies f to the header of each file in the tar inputted in in_fd, and writes the resulting headers to out_fd preserving the content and structure of the archive.

val create : string list -> Lwt_unix.file_descr -> unit Lwt.t

Create a tar on file descriptor fd from a list of filenames. It only supports regular files.

OCaml

Innovation. Community. Security.