package tar-format
Library
Module
Module type
Parameter
Class
Class type
Process and create tar file headers
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 Pervasives.ref
Default compatibility if ?level
is omitted. Defaults to V7
module Link : sig ... end
type 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;
}
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 ->
t
Helper function to make a simple header
val zero_block : Cstruct.t
A blank header block (two of these in series mark the end of the tar)
val to_detailed_string : t -> string
Pretty-print the header record
Thrown if we detect the end of the tar (at least two zero blocks in sequence)
val unmarshal : ?level:compatibility -> Cstruct.t -> t option
Unmarshal a header block, returning None if it's all zeroes
val marshal : ?level:compatibility -> Cstruct.t -> t -> unit
Marshal a header block, computing and inserting the checksum
val compute_zero_padding_length : t -> int
Compute the amount of zero-padding required to round up the file size to a whole number of blocks
val to_sectors : t -> int64
to_sectors t
is the number of sectors occupied by the data