← all modules

Std.Zip

Std.Zip
  Std.Zip — read and write ZIP archives safely.

Types
  type alias Entry = { path : String , bytes : String }
  type alias EntryInfo = { path : String , size : Int , compressedSize : Int , isDirectory : Bool , modified : Int }
  type alias Limits = { maxEntries : Int , maxEntryBytes : Int , maxTotalBytes : Int , maxRatio : Int }
  type Method = Deflate | Store

Values
  defaultLimits : Limits
      10,000 entries, 50 MiB an entry, 200 MiB in all, a ratio of 200.
  list : String -> Result Error (List EntryInfo)
      The entries of an archive, read from the central directory only (nothing
  read : String -> Result Error (List Entry)
      Every file in an archive, in archive order, under `defaultLimits`.
  readEntry : Limits -> String -> String -> Result Error (Maybe String)
      One file by its path, or `Nothing` when the archive has no such file.
  readWith : Limits -> String -> Result Error (List Entry)
      `read` with chosen limits.
  write : List Entry -> Result Error String
      Build an archive with `Deflate`. Every entry gets the time 1980-01-01
  writeWith : Method -> List Entry -> Result Error String
      `write` with a chosen `Method`.