PureZIP library : ZIP / UNZIP files

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

Moderator: gnozal

User avatar
Frontier
User
User
Posts: 74
Joined: Thu Dec 22, 2005 2:43 pm
Location: Chios, Greece
Contact:

Post by Frontier »

Thanks DoubleDutch, I haven't seen this :)
Micko
Enthusiast
Enthusiast
Posts: 244
Joined: Thu May 24, 2007 7:36 pm
Location: Senegal
Contact:

Post by Micko »

User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Post by Sveinung »

@gnozal

Will your lib support the inflate() and deflate() commands (zLib 1.23) ?

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

Post by gnozal »

Sveinung wrote:Will your lib support the inflate() and deflate() commands (zLib 1.23) ?
No, sorry.
I chose to only expose ready to use ZIP compatible functions.

But if you need 'raw' compression you could try PureZIP_PackMemory() / PureZIP_UnpackMemory() wich implement the ZLIB compress() and uncompress() functions. Or PB's JCALG1 compression routines. Or BriefLZ.

Here you will find some deflate / gz examples : http://www.purebasic.fr/german/viewtopic.php?t=10088
Or here (same code examples but with static library instead of userlibrary) : http://freenet-homepage.de/gnozal/PBLIB ... c_GZip.zip
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Post by Sveinung »

Will you lib support file sizes above 4 Gb?

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

Post by gnozal »

Sveinung wrote:Will you lib support file sizes above 4 Gb?
No. It's a ZLIB limit. The library uses longs.
Anyway, for serious archiving, I would use something like 7ZIP or SQX.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Post by Sveinung »

Thank you and 7Zip it will be :D

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

Post by DoubleDutch »

On PB4.20b5 the V4.20 library get a polink error if this is included:

Code: Select all

Debug PureZIP_AddFiles(myzip$,"data\*.*",#PureZIP_StorePathAbsolute,#PureZIP_RecursiveZeroDirs)
It says the polink error is to do with PB_Delay?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
graves
Enthusiast
Enthusiast
Posts: 160
Joined: Wed Oct 03, 2007 2:38 pm
Location: To the deal with a pepper

Post by graves »

Confirmed,

Up to 126 programs correctly compiled with 4.20b5.
But the only one using PureZip4.20 (v1.93) gives an error:

Code: Select all

Error: Linker
POLINK: error: Unresolved external symbol 'PB_Delay'.
POLINK: fatal error: 1 unresolved external(s).
I don't use the "Delay" OR "Debug" commands on my code.
I'm using

Code: Select all

PureZIP_AddFiles(zipfile$, abspath$\*.*, #PureZIP_StorePathRelative, #PureZIP_Recursive)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

When I have some time, I will update my libs for beta 5 (they will be updated for PB4.20 final, but I may not have the time to update for every new beta).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

No problem.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
graves
Enthusiast
Enthusiast
Posts: 160
Joined: Wed Oct 03, 2007 2:38 pm
Location: To the deal with a pepper

Post by graves »

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

Post by gnozal »

Update

(PB 4.2x version only)

Changes :
- recompiled with PB 4.20 beta 6
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Post by kinglestat »

is it normal that when I compress with PureZIP_PackMemory, and after unpack with PureZIP_UnpackMemory, the original uncompressed size is different?
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

kinglestat wrote:is it normal that when I compress with PureZIP_PackMemory, and after unpack with PureZIP_UnpackMemory, the original uncompressed size is different?
Seems to be the same length here [tested with PB4.20] :

Code: Select all

PackTest.s = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
SourceLength = Len(PackTest)
Debug SourceLength
*SourceMemoryID = AllocateMemory(SourceLength)
PokeS(*SourceMemoryID, PackTest, SourceLength)
DestinationLength = SourceLength + (SourceLength * 0.01) + 12
*DestinationMemoryID = AllocateMemory(DestinationLength)
Debug PureZIP_PackMemory(*SourceMemoryID, SourceLength, *DestinationMemoryID, @DestinationLength)
Debug DestinationLength
Debug PureZIP_UnpackMemory(*DestinationMemoryID, DestinationLength, *SourceMemoryID, @SourceLength)
Debug SourceLength
UnpackTest.s = Space(SourceLength)
UnpackTest = PeekS(*SourceMemoryID, @SourceLength)
Could you provide some code example ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply