PureZIP library : ZIP / UNZIP files

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update
New function : PureZIP_SetArchivePassword() ; set current archive password for both compress and extract functions.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update
- PureZIP now uses ZLIB's crc32() instead of PB's CRC32FingerPrint()
- New ZLIB functions in PureZIP_W library
- Somes fixes with password and compress from memory
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

Sweet dude.. love this lib!

- np
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update
- ZLIB static lib is now V1.2.3

Update information

zlib 1.2.3

July 18, 2005

Version 1.2.3 eliminates potential security vulnerabilities in zlib 1.2.1 and 1.2.2, so all users of those versions should upgrade immediately. The following important fixes are provided in zlib 1.2.3 over 1.2.1 and 1.2.2:
Eliminate a potential security vulnerability when decoding invalid compressed data
Eliminate a potential security vulnerability when decoding specially crafted compressed data
Fix a bug when decompressing dynamic blocks with no distance codes
Fix crc check bug in gzread() after gzungetc()
Do not return an error when using gzread() on an empty file
Last edited by gnozal on Fri Jul 22, 2005 10:25 am, edited 1 time in total.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

would be nice to get a ZIP-lib including with source to avoid the desaster with previous versions and compatibility.
just a suggestion
SPAMINATOR NR.1
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Rings wrote:would be nice to get a ZIP-lib including with source to avoid the desaster with previous versions and compatibility.
just a suggestion
There will be no disaster : :wink:
- no source lost after a hard disk crash (I make backups) ;
- no version compatibility problem (if I loose interest in Purebasic, I will release all my lib sources like you or Danilo did).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

i thought only that most of the stuff (ZLib) is already OpenSource or under a GPL.Don't know exactly if you wrote more than a wrapper.
Same also for BriefLZ, I released my wrapper to the public.

its your choice.
SPAMINATOR NR.1
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

gnozal wrote:Update
- ZLIB static lib is now V1.2.3
Where do we get the new version?

- np
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

Thanks man.. 8)
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

I tried this:

Code: Select all

myzip.s = "test.zip"
myzipfile1.s = "t.mp3"
myzipfile2.s = "a.txt"



If PureZIP_Archive_Create(MyZIP.s, #APPEND_STATUS_CREATE)
  Debug PureZIP_Archive_Compress(MyZIPFile1.s, #FALSE)
  Debug PureZIP_Archive_Compress(MyZIPFile2.s, #FALSE)
  PureZIP_Archive_Close()
EndIf
And I get VERY interesting results..

From inside the IDE, works great.. if I compile out to an exe.. I get a
22 byte file..?
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Rings wrote:i thought only that most of the stuff (ZLib) is already OpenSource or under a GPL.Don't know exactly if you wrote more than a wrapper.
There are 3 libs :
- PureZIP_O : original ZLIB static lib
- PureZIP_W : wrapper to ZLIB static lib
- PureZIP_L : ZIP and UNZIP functions using PureZIP_W functions (not a wrapper, you have to use the basic ZLIB functions to build ZIP archive compatible functions)
NoahPhense wrote:From inside the IDE, works great.. if I compile out to an exe.. I get a 22 byte file..?
Yes, strange (never tested it like this, only in 'real' apps)...
With this I get a 22 byte file :

Code: Select all

myzip.s = "c:\purebasic393\program\PureZIP-test.zip" 
myzipfile1.s = "C:\PureBasic393\Program\PureCOLOR_TEST_2.pb" 
myzipfile2.s = "C:\PureBasic393\Program\PureCOLOR_TEST_3.pb" If PureZIP_Archive_Create(myzip.s, #APPEND_STATUS_CREATE) 
  PureZIP_Archive_Compress(myzipfile1.s, #False)
  PureZIP_Archive_Compress(myzipfile2.s, #False)
  PureZIP_Archive_Close() 
EndIf
But this works (CON exe) :

Code: Select all

myzip.s = "c:\purebasic393\program\PureZIP-test.zip" 
myzipfile1.s = "C:\PureBasic393\Program\PureCOLOR_TEST_2.pb" 
myzipfile2.s = "C:\PureBasic393\Program\PureCOLOR_TEST_3.pb" 
OpenConsole()
If PureZIP_Archive_Create(myzip.s, #APPEND_STATUS_CREATE) 
  PureZIP_Archive_Compress(myzipfile1.s, #False)
  PureZIP_Archive_Compress(myzipfile2.s, #False)
  PureZIP_Archive_Close() 
EndIf
CloseConsole()
And this works (GUI exe):

Code: Select all

myzip.s = "c:\purebasic393\program\PureZIP-test.zip" 
myzipfile1.s = "C:\PureBasic393\Program\PureCOLOR_TEST_2.pb" 
myzipfile2.s = "C:\PureBasic393\Program\PureCOLOR_TEST_3.pb" 
If OpenWindow(0,0,0,0,0,0,"")
  If PureZIP_Archive_Create(myzip.s, #APPEND_STATUS_CREATE) 
    PureZIP_Archive_Compress(myzipfile1.s, #False)
    PureZIP_Archive_Compress(myzipfile2.s, #False)
    PureZIP_Archive_Close() 
  EndIf
EndIf
So it works, but not without console or window ; I don't know why ...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
PAMKKKKK
User
User
Posts: 18
Joined: Sun May 01, 2005 7:55 am
Location: Germany Braunschweig
Contact:

Post by PAMKKKKK »

@gnozal
Thanks a lot for your hard Work!!!!!!!

I am working under Windows XP and PB 3.93.

The Memorycompress example works fine.

The PureZIP_Archive_Create() command seems to be OK.

But if i try to Compile with PureZIP_Archive_Compress(), i get this error:

Image
The flags are always the same.

Please write the explanaition in all your helpfiles:
There are 3 libs :
- PureZIP_O : original ZLIB static lib
- PureZIP_W : wrapper to ZLIB static lib
- PureZIP_L : ZIP and UNZIP functions using PureZIP_W functions (not a wrapper, you have to use the basic ZLIB functions to build ZIP archive compatible functions)
It took me a long time to find out what is what.
I thought PureZIP_W stands for Windows and PureZIP_L for Linux....
Develop Standards, and you develop the World!
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Shouldnt PureZIP_L be called PureZIP_F ? (for: Functions)...
Doesnt seem like he likes to gift his sources - which is ok, but however hes giving the libs for free why you ask for more? You people... always trying to suck as much as possible from others!!!
:lol: :lol:
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

PAMKKKKK wrote:But if i try to Compile with PureZIP_Archive_Compress(), i get this error
Could you provide some code please ?
dagcrack wrote:Shouldnt PureZIP_L be called PureZIP_F ? (for: Functions)
Well, it's L for library :wink:
dagcrack wrote:Doesnt seem like he likes to gift his sources - which is ok, but however hes giving the libs for free why you ask for more? You people... always trying to suck as much as possible from others!!!
I could add a sentence like Fangbeast : "As with all my apps, use this if you like it, don't use it if you don't like it. Suggestions on how to improve, bug reports are welcome. Stupid comments, criticisms, arrogant gum flapping etc, are not." :twisted:

Note :
There is a known problem with PureZIP and the ImagePluginPNG purebasic library. If you use both in the same program, you will get a POLINK error "Symbol '_inflate_copyright' is multiply defined" because both use the ZLIB static library.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply