Module Storage.ZipStore

An Lwt-aware Zip file storage backend for a Zarr v3 hierarchy.

include Zarr.Storage.STORE with module Deferred = Deferred
module Deferred = Deferred
type t

The storage type.

module Group : sig ... end
module Array : sig ... end
val hierarchy : t -> (Zarr.Node.Array.t list * Zarr.Node.Group.t list) Deferred.t

hierarchy t returns p where p is a pair of lists representing all nodes in store t. The first element of the pair is a list of all array nodes, and the second element is a list of all group nodes. This operation returns a pair of empty lists if store t is empty.

  • raises Parse_error

    if any node has invalid node_type metadata.

val clear : t -> unit Deferred.t

clear t clears the store t by deleting all nodes. If the store is already empty, this is a no-op.

val with_open : ?level:[ `None | `Fast | `Default | `Best ] -> ?perm:int -> [< `Read_only | `Read_write ] -> string -> (t -> 'a Deferred.t) -> 'a Deferred.t

with_open mode p f opens the zip archive at path p and applies function f to its open handle and writes any changes back to the zip archive if mode is `Read_write, otherwise discards them at exit. If p does not exist, a handle to an empty zip archive is opened. Note that this function loads the entire zip archive bytes into memory, so care must be taken to ensure that these bytes can fit into the local machine's available memory. For now it does not handle ZIP64. ZIP64 is needed if your ZIP archive or decompressed file sizes exceed 232-1 bytes or if you need more than 65535 archive members.

  • level is the DEFLATE algorithm compression level used when writing data to the store and defaults to `Default. Choose `None for no compression, `Fast for best speed, `Best for high compression rate and `Default for a mix of good speed and compression rate.
  • perm is the file permission to use when opening an existing zip file and defaults to 0o700.