module Read: sig
.. end
Read-only archive
This module allow to manipulate a read-only archive. Beware that the
data defined in input
will be used at creation to scan the content
of the archive and then will be reused to fetch content. This means that
the matching file can be open more than once.
type ('a, 'b)
input = [ `Callback of
'a * ('a, 'b) ArchiveLow.open_callback * 'b ArchiveLow.read_callback *
'b ArchiveLow.skip_callback * 'b ArchiveLow.close_callback
| `Filename of Archive.filename ]
type ('a, 'b)
t
val create : ('a, 'b) input -> ('a, 'b) t
Create the archive and do an initial scan of the content
val file_exists : ('a, 'b) t -> Archive.filename -> bool
Test file existence in the archive
val stat : ('a, 'b) t -> Archive.filename -> Unix.LargeFile.stats
Get Unix statistics about a filename in the archive
val is_directory : ('a, 'b) t -> Archive.filename -> bool
Test if a filename is a directory
val entry : ('a, 'b) t -> Archive.filename -> ArchiveLow.Entry.t
Get the entry of a filename
val with_file : ('a, 'b) t ->
Archive.filename ->
(ArchiveLow.Entry.t -> 'c) -> ('c -> string -> int -> 'c) -> ('c -> 'd) -> 'd
with_file t fn open read close
Read the content of a file, use the
callbacks function open
, read
and close
to push the data.
val content : ('a, 'b) t -> Archive.filename -> string
val readdir : ('a, 'b) t -> Archive.filename -> Archive.filename array
List content of a directory