« Developer Meetings fo… | Home | MBS Xojo / Real Studi… »

New Archive classes for handling zip and tar archives

We got new classes for handling archives using libarchive. The new ArchiveReaderMBS class can read an archive and you can easily extract file information and content. The ArchiveWriterMBS class can write archives. Both classes read/write in chunks and process archives serially. Compression is supported with zip (deflate) and bzip2 compression. Here an example for going over any supported archive format and read the file names:
dim a as new ArchiveReaderMBS

// open file
dim f as FolderItem = SpecialFolder.Desktop.Child("test.zip")

if not a.OpenFile(f) then
Break // path invalid?
end if

dim e as ArchiveEntryMBS = a.NextHeader
while e <> nil
print e.PathName

e = a.NextHeader
The biggest plugin in space...
24 05 16 - 10:56