-- ************************************************************************
-- Script: ZIPLIST
-- Version: 0.2 - D11.5 version based on bytearray
-- Date: 2009-04-06
--
-- purpose:
-- returns list of files found in ZIP archive
--
-- requirements:
-- fileIO xtra and FILE_FILEIO interface script
--
-- usage:
-- put ziplist("c:\test.zip")
-- ************************************************************************
on ziplist fn
fp = fopen(fn, "rb")
if fp=0 then return
fsize = fsize(fp)
fseek (fp, fsize-6)
pos = freadint32(fp)
fseek (fp, pos)
filelist = []
repeat while true
if freadint32(fp)<>33639248 then exit repeat -- P K 01 02 = 33639248
fseek(fp, 24, 1)
len = freadint16(fp)
fseek(fp, 16, 1)
filelist.add(fread(fp, len))
end repeat
fclose(fp)
return filelist
end