include module type of Header
type compatibility = | OldGNU | GNU tar < 1.12 |
| GNU | GNU tar 1.12 - 1.13.25 |
| V7 | Origin 7th Release format |
| Ustar | POSIX.1-1988 |
| Posix | POSIX.1-2001 |
tar format assumptions. Default is V7 (for compatibility with versions of ocaml-tar before this type was introduced). See http://www.gnu.org/software/tar/manual/html_section/tar_68.html for more information.
val compatibility_level : compatibility Stdlib.refDefault compatibility if ?level is omitted. Defaults to V7
module Link : sig ... endmodule Extended : sig ... endtype t = {file_name : string; |
file_mode : int; |
user_id : int; |
group_id : int; |
file_size : int64; |
mod_time : int64; |
link_indicator : Link.t; |
link_name : string; |
uname : string; |
gname : string; |
devmajor : int; |
devminor : int; |
extended : Extended.t option; |
}Represents a standard archive (note checksum not stored)
val make : ?file_mode:int -> ?user_id:int -> ?group_id:int -> ?mod_time:int64 -> ?link_indicator:Link.t -> ?link_name:string -> ?uname:string -> ?gname:string -> ?devmajor:int -> ?devminor:int -> string -> int64 -> tHelper function to make a simple header
val zero_block : Cstruct.tA blank header block (two of these in series mark the end of the tar)
val to_detailed_string : t -> stringPretty-print the header record
Thrown if we detect the end of the tar (at least two zero blocks in sequence)
val unmarshal : ?level:compatibility -> ?extended:Extended.t -> Cstruct.t -> t optionUnmarshal a header block, returning None if it's all zeroes. This header block may be preceeded by an ?extended block which will override some fields.
val marshal : ?level:compatibility -> Cstruct.t -> t -> unitMarshal a header block, computing and inserting the checksum
val compute_zero_padding_length : t -> intCompute the amount of zero-padding required to round up the file size to a whole number of blocks
val to_sectors : t -> int64to_sectors t is the number of sectors occupied by the data
val get_next_header : ?level:compatibility -> IO.in_channel -> tReturns the next header block or fails with `Eof if two consecutive zero-filled blocks are discovered. Assumes stream is positioned at the possible start of a header block. End_of_file is thrown if the stream unexpectedly fails