package zipc

  1. Overview
  2. Docs

Module Zipc.MemberSource

Archive members.

Members

Sourcetype kind =
  1. | Dir
    (*

    Member is a directory.

    *)
  2. | File of File.t
    (*

    Member is a file.

    *)

The type for archive member kinds.

Sourcetype t

The type for archive members.

Sourceval make : ?mtime:Ptime.t -> ?mode:int -> path:Fpath.t -> kind -> (t, string) result

make ~path kind creates a member for path of kind kind.

  • path goes through Fpath.ensure_unix and, if the member is a directory, Fpath.ensure_directoryness. Note that when you add the resulting member to an archive you may not be able to find it with the given path, you need to use the path of the result.
  • mtime defaults to Ptime.dos_epoch. ZIP archives use MS-DOS date time whose epoch is on Ptime.dos_epoch anything before is truncated to it
  • mode defaults 0o755 for directory entries and 0o644 for files.

Error _ is returned with a suitable error message if the length of path exceeds max_path_length.

Sourceval path : t -> Fpath.t

path m is the file path of m.

WARNING do not use this path on a file system without sanitizing it. Also, it may be the empty string.

Sourceval mode : t -> Fpath.mode

mode m is the UNIX file mode of m.

Sourceval mtime : t -> Ptime.t

mtime m is the last modification time of m.

Sourceval kind : t -> kind

kind m is the kind of member of m.

Sourceval pp : Format.formatter -> t -> unit

pp_member formats members a bit like ls -l does. The reported byte size is the File.decompressed_size.

Sourceval pp_long : Format.formatter -> t -> unit

pp_long is like pp but adds more information.

Limits

Sourceval max : int

max is 65535, the maximum number of members that can be encoded in a (non-ZIP64) ZIP archive.

Sourceval max_path_length : int

max_path_length is 65535, the maximal size for member paths in ZIP archives.