-
I found a module that has ZIP functionality features - but it's got no comments on how to pass an argument or request to it...
What I'm trying to do is:
> Find all *.zip files in a directory (*.zip in (say) C:\MyFolder)
> Browse into each zip file and search for specific files (find any files that end in (say) *.txt)
> Load those files into a list box
I'd really appreciate any help - and espically the location of a zip functionality module that has comments or insturctions on how to use it.
Thanks!
-
Here's some work i did a while ago, maybe you could continue on it, zip's really a great compression format
Code:
'mPKZIP.bas 10.10.00 Kedaman
'This is just a test, i dl the zip description from wotsit.org and thought
'i could make my own unzipping library, here's what i have so far
Type fileHeader
Signature As Long
version As Integer
biflag As Integer
packmethod As Integer
lastmodtime As Integer
lastmoddate As Integer
crc32 As Long
Sizepacked As Long
Sizeunpacked As Long
filenamelen As Integer
extrafieldlen As Integer
End Type
Function FilesInZip() As String()
Dim temp As fileHeader, buffer() As Byte, n As Long, result() As String
Open "C:\windows\desktop\zip_form.zip" For Binary As 1
Do
Get #1, , temp
'signature might be wrong if you have come to the directory section
If temp.Signature <> 67324752 Then Exit Do
ReDim buffer(temp.filenamelen - 1)
Get #1, , buffer
ReDim Preserve result(n)
result(n) = StrConv(buffer, vbUnicode)
'the third bit should determine if theres an extra descriptor
Seek 1, Seek(1) + temp.Sizepacked - 6 * CBool(temp.biflag And 8)
n = n + 1
Loop While Loc(1) < LOF(1)
Close #1
FilesInZip = result
End Function
'to try this for instance in immediate window, type
'For Each n In FilesInZip: ?n: Next n
'Function Unzip(Fileindex As Long)
'
'End Function
BTW, do you need recursive or nonrecursive directory search?