package tar
Decode and encode tar format files in pure OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
tar-2.6.0.tbz
sha256=caff0cb7046343e2bff7fc0f9217e4e31235555e4c4889fb194792985b6fb1ee
sha512=61cedd25de48cfa8092b4e03e275139ff27aa36f3e24f936bc90e2974e3c52b2460db214b3f8480c6d45bbc59bf2232623dd840b4ce445077393a71e0d005903
doc/tar.gz/Tar_gz/Make/index.html
Module Tar_gz.Make
Source
Parameters
module Writer : Tar.WRITER with type 'a t = 'a Async.t
Signature
Returns the next header block or fails with Tar.Header.End_of_stream
if two consecutive zero-filled blocks are discovered. Assumes stream is positioned at the possible start of a header block.
really_read fd buf
fills buf
with data from fd
or raises Stdlib.End_of_file
.
Source
val of_out_channel :
?bits:int ->
?q:int ->
level:int ->
mtime:int32 ->
Gz.os ->
Writer.out_channel ->
out_channel
Source
val write_block :
?level:Tar.Header.compatibility ->
Tar.Header.t ->
out_channel ->
(unit -> string option Async.t) ->
unit Async.t
write_block hdr oc stream
writes hdr
, then deflate the given stream
, then zero-pads so the stream is positionned for the next block.
A simple usage to write a file:
let stream_of_fd fd =
let buf = Bytes.create 0x1000 in
fun () -> match Unix.read fd buf 0 (Bytes.length buf) with
| 0 -> None
| len -> Some (Bytes.sub_string buf 0 len)
| exception End_of_file -> None
let add_file oc filename =
let fd = Unix.openfile filename Unix.[ O_RDONLY ] 0o644 in
let hdr = Tar.Header.make ... in
write_block hdr oc (stream_of_fd fd) ;
Unix.close fd
write_end oc
writes a stream terminator to oc
.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page