Adding simple support for zip wasn't too difficult thanks to the underlying C# framework.
The first version, coming in the next release (https://feedback.objo.dev/feature/415) adds a new Zip module to the ObjoBasic standard library:
Zip.Create(sourceFolder, destinationFile)
Zip.Create(sourceFolder, destinationFile, options)
Zip.Extract(archiveFile, destinationFolder)
Zip.Extract(archiveFile, destinationFolder, options)
Zip.Entries(archiveFile)
Zip.IsValid(archiveFile)
Example:
Var source As FileSystemItem = SpecialFolder.Documents.Child("Export")
Var archive As FileSystemItem = SpecialFolder.Desktop.Child("Export.zip")
Var options As New ZipCreateOptions
options.Overwrite = True
options.Compression = ZipCompression.Optimal
Zip.Create(source, archive, options)
And extraction:
Var destination As FileSystemItem = SpecialFolder.Temporary.Child("Import")
Var options As New ZipExtractOptions
options.Overwrite = True
Zip.Extract(archive, destination, options)
There is also a ZipEntry type for inspecting archive contents without extracting them:
For Each entry As ZipEntry In Zip.Entries(archive)
Print(entry.Path)
Next
Extraction is deliberately safe by default: archive entries that try to write outside the destination folder are rejected.
This is intended as a practical first version. It lets you create archives, extract archives, inspect entries, validate zip files, and control overwrite/compression behaviour. If needed, more advanced archive editing can be considered later.