Tar.HeaderProcess and create tar file headers.
tar format assumptions. Default is V7 (for compatibility with versions of ocaml-tar before this type was introduced).
val compatibility : compatibility option -> compatibilityReturn the compatibility level, 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).
Helper function to make a simple header.
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 ->
tmake file_name file_size creates a simple header. file_mode defaults to 0o400, user_id, group_id default to 0, mod_time defaults to 0L (epoch), link_indicator defaults to Normal, link_name, uname and gname default to "", and devmajor and devminor default to 0.
val to_detailed_string : t -> stringPretty-print the header record.
val unmarshal :
?extended:Extended.t ->
string ->
(t, [> `Zero_block | `Checksum_mismatch | `Unmarshal of string ])
Stdlib.resultUnmarshal a header block, returning None if it's all zeroes. This header block may be preceded by an ?extended block which will override some fields.
val marshal :
?level:compatibility ->
bytes ->
t ->
(unit, [> `Msg of string ]) Stdlib.resultMarshal 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 zero_padding : t -> stringReturn the required zero-padding as a string.
val to_sectors : t -> int64to_sectors t is the number of sectors occupied by the data.