package tar

  1. Overview
  2. Docs

Utility functions for operating over whole tar archives

val with_next_file : IO.in_channel -> (IO.in_channel -> Header.t -> 'a) -> 'a

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:Header.compatibility -> IO.in_channel -> Header.t list

List the contents of a tar

val extract_gen : (Header.t -> IO.out_channel) -> IO.in_channel -> unit

extract_gen dest extract the contents of a tar. Apply 'dest' on each header to get a handle to the file to write to

val create_gen : ?level:Header.compatibility -> (Header.t * (IO.out_channel -> unit)) Stream.t -> IO.out_channel -> unit

Create a tar on file descriptor fd from the stream of headers.

val copy_n : IO.in_channel -> IO.out_channel -> int64 -> unit

copy_n ifd odf n copies exactly n bytes from ifd to ofd

  • deprecated Deprecated: use your own helper function
val skip : IO.in_channel -> int -> unit

skip fd n reads and throws away n bytes from fd

  • deprecated Deprecated: use your own helper function