List of Files within a Zip Archive
Keywords: file list
Question:
Is there an easy way to get a list of the files inside a zipfile? In the following line, the result does not seem
usable. I simply want the list of the files...
data=zunZipFiles("l", "zipfile", "*.*", "", "c:\")
Answer:
AddExtender("wwzip34I.dll")
zipfile="C:\Incoming\1 work\wwads34i.zip"
data=zunZipFiles("l", zipfile, "*.*", "", "c:\temp")
;data=StrReplace(data,@crlf,@tab)
datacount=ItemCount(data,@tab)
filelist=""
for xx=1 to datacount
thisline=ItemExtract(xx,data,@tab)
if strindex(thisline,"Central directory entry #",0,@fwdscan) !=0
xx=xx+3
file=StrTrim(ItemExtract(xx,data,@tab))
if filelist=="" then filelist=file
else filelist=strcat(filelist,@tab,file)
endif
next
AskItemList("File List",filelist,@tab,@unsorted,@single)
Article ID: W14564
Filename: List of Files in Zip Archive.txt