Xbase++ Requires Chilkat v11.0.0+
Xbase++
List Files in a .zip
See more Zip Examples
How to list files within a .zipChilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oZip
LOCAL n
LOCAL oEntry
LOCAL i
nSuccess := 0
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
oZip := CreateObject("Chilkat.Zip")
nSuccess := oZip:OpenZip("a.zip")
IF (nSuccess == 0)
? oZip:LastErrorText
oZip:destroy()
RETURN
ENDIF
// Get the number of files and directories in the .zip
n := oZip:NumEntries
oEntry := CreateObject("Chilkat.ZipEntry")
i := 0
DO WHILE i < n
oZip:EntryAt(i, oEntry)
IF (oEntry:IsDirectory == 0)
// (the filename may include a path)
? oEntry:FileName
ENDIF
i := i + 1
ENDDO
oZip:destroy()
oEntry:destroy()