zipbeam
Types
A file within a zip archive.
pub type File {
File(path: String, size_bytes: Int)
}
Constructors
-
File(path: String, size_bytes: Int)
pub opaque type ZipBuilder
Values
pub fn add_file(
builder: ZipBuilder,
at path: String,
containing contents: BitArray,
) -> ZipBuilder
Add a file to the builder, to be included in the zip archive.
pub fn files(handle: ZipHandle) -> Result(List(File), Nil)
List the files in the zip archive, including their uncompressed sized.
Returns an error if the handle has already been closed.
pub fn get(
handle: ZipHandle,
path: String,
) -> Result(BitArray, Nil)
Get a file from the archive.
Security
You must always check the size of the file with files before extracting a
file, to prevent zip-bomb attacks.
pub fn new() -> ZipBuilder