Skip to content
子悦解说 edited this page Sep 16, 2024 · 3 revisions

Warning

This library has known bugs. It doesn't deal with non-ASCII filenames correctly. It doesn't deal with passwords correctly.

Blib is a library for compressing/uncompressing files, based on Zip Utils.

Glossary

HZIP

HZIP is a class, its instance represents a zip file.

ZIPENTRY

ZIPENTRY is a class, its instance stores information of the zip file.

Functions List

Function Description
BlibCreateZip%(file$, password$ = "") Create file$ as a zip file with the specific password. password$ = "" represents no password. Returns a HZIP instance.
BlibOpenZip%(file$, password$ = "") Open file$ as a zip file with the specific password. password$ = "" represents no password. Returns a HZIP instance.
BlibZipAdd(hzip%, dst$, src$) Add a file into the zip file. src$ is the source file's path, and dst$ is the path of src$ in the zip file.
BlibZipRemove(hzip%, dst$) Remove a file from the zip file. dst$ is the file path in the zip file.
BlibZipAddFolder(hzip%, dst$) Add an empty folder in the zip file. dst$ is the folder path in the zip file.
BlibCloseZip(hzip%) Close a HZIP instance. All HZIP must be closed after the operation.
BlibGetZipItem%(hzip%, index%) Get a file from index. Returns a ZIPENTRY instance.
BlibUnzipItem(hzip%, index%, zipentry%, dst$) Extract a file by ZIPENTRY instance. dst$ is the extracted file's path.
BlibFindZipItem%(hzip%, name$, ic%, zipentry%) Find a file by filename. If the filename is not case-sensitive, set ic% as True. Returns the index of the file.
BlibSetUnzipBaseDir(hzip%, dir$) Set the base directory in the zip file.
BlibZipEntryName$(zipentry%) Get the filename by a ZIPENTRY instance.
BlibUnzip(zip$, dst$, password$ = "") Extract a zip file. password$ = "" represents no password.

Changelogs

Version Changes
v1.01 Removed BlibZipEntryIndex%(zipentry%), BlibZipEntryAttr%(zipentry%), BlibZipEntryComSize%(zipentry%), BlibZipEntryUncomSize%(zipentry%), and BlibHzipUnused%(hzip%).
Clone this wiki locally