Overview
Code: Select all
The purpose of PureZIP is to handle ZIP files.
It uses the ZLIB library 1.2.3 (c) 1995-2004 Jean-loup Gailly and Mark Adler modified by Gilles Vollant.
The library supports classic PKZIP 2.04g archives :
- compression
- extraction
- encryption (ZIP 2.0)
... and for the latest versions :
- file deletion in archive
- file renaming in archive
- read archive from memory
PB3.94 : http://gnozal.ucoz.com/PureZIP.htm
PB4.xx : http://gnozal.ucoz.com/PureZIP_.htm
Example
Code: Select all
Procedure CallbackForTest(file.s, PerCent.f)
Debug StrF(PerCent, 2) + "%"
EndProcedure
;
myFileinfo.PureZIP_FileInfo
PureZIP_SetProgressionCallback(@CallbackForTest())
;
MyZIP.s = "C:\PureBasic393\Program\PureZIP\essai1\test.zip"
MyFilesToZIP.s = "C:\PureBasic393\Program\PureBriefLZ\*.*"
MyZIPOutPut.s = "C:\PureBasic393\Program\PureZIP\essai3\"
; Create archive
Debug PureZIP_AddFiles(MyZIP, MyFilesToZIP, #PureZIP_StorePathAbsolute, #PureZIP_Recursive)
; Extract files from archive
Debug PureZIP_ExtractFiles(MyZIP, "*.*", MyZIPOutPut, #TRUE)
; Count files in archive
Debug PureZIP_GetFileCount(MyZIP)
; Add memory bank to archive
Debug PureZIP_AddMemory(MyZIP, "MemoryTest.txt", @MyZIP, Len(MyZIP))
; On file more in archive :
Debug PureZIP_GetFileCount(MyZIP)
; Get files information
For i = 0 To PureZIP_GetFileCount(MyZIP) - 1
Debug PureZIP_GetFileInfo(MyZIP,i , @myFileinfo)
Debug "Number " + Str(i)
Debug "Filename: " + myFileinfo\FileName
Debug "Compressed Size: " + Str(myFileinfo\CompressedSize)
Debug "Uncompressed Size: "+ Str(myFileinfo\unCompressedSize)
Debug "--------------"
Next
Only available for Purebasic Windows x86
PB3.94 : http://gnozal.ucoz.com/PureZIP.zip
PB4.0x - 4.10 : http://gnozal.ucoz.com/PureZIP_.zip
PB4.20 : http://gnozal.ucoz.com/PureZIP___.zip
PB4.3x : http://gnozal.ucoz.com/PureZIP_430.zip
PB4.4x : http://gnozal.ucoz.com/PureZIP_440.zip
PB4.5x : http://gnozal.ucoz.com/PureZIP_450.zip
PB4.6x : http://gnozal.ucoz.com/PureZIP_460.zip
PB5.0x : http://gnozal.ucoz.com/PureZIP_500.zip
Shared library (DLL) : http://gnozal.ucoz.com/PureZIP_DLL.zip [based on UserLib for PB4.xx code]
Notes :
1. Unicode : the ZIP standard doesn't support unicode files names. In a (PKZIP 2.04g) ZIP archive, the filenames are stored as OEM (MS-DOS, remember ?). The unicode version of PureZIP translates unicode to OEM and vice-versa. It works, but it is not 'true' unicode support...
Some newer archivers (like Pkzip 4.5+ / Winzip 11.2+) store unicode names using the UTF-8 standard. This method isn't compatible with older ZIP packers. Others store Unicode names in an extra field (like the Info-Zip method). But there is no real standard. If you need real unicode support, better use RAR or 7-ZIP.
2. Archive size : PureZIP (ZLIB) should support archive sizes up to 4GB. However ZIP is not recommended for big archives, because some compressors achieve much better compression ratio (RAR, 7-ZIP, ...), and ZIP doesn't have recovery capabilities like RAR for example.
3. GZ archives : PureZIP does not support GZ archives ; you may however try the following include + static ZLIB.