it says unzOpen not found I have zlib install in bmx ng
Import Pub.ZLib
UnpackZip("date.zip","test.txt")
Function UnpackZip(filename$,filename2$)
Local result:Int = 0
Local outStream:TStream = WriteStream(filename2$)
Local numberOfBytes:Int
Local data:Byte Ptr
zipFile = unzOpen(filename$)
If (zipFile) Then
result = unzLocateFile( zipFile, filename2$, UNZ_NO_CASE_CHECK )
If ( result = UNZ_OK ) Then
result = unzOpenCurrentFile( zipFile )
If ( result = UNZ_OK ) Then
Local size = unzGetCurrentFileSize(zipFile)
data = New Byte Ptr[size]
numberOfBytes = unzReadCurrentFile (zipFile, data, size )
For i:Int = 1 To size
WriteByte( outStream, data[i] )
Next
CloseStream ( outStream )
End If
End If
unzClose( zipFile )
End If
End Function
|