PureZIP library : ZIP / UNZIP files

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

Moderator: gnozal

endo
Enthusiast
Enthusiast
Posts: 141
Joined: Fri Apr 30, 2004 10:44 pm
Location: Turkiye (istanbul)
Contact:

Post by endo »

gnozal wrote:
endo wrote:wow, u r fast! I'm waiting thx :)
... should be fixed (same link).
it works! thanks a lot.
-= endo (registered user of purebasic since 98) =-
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post by Inner »

PB4.30, using your latest release posted above.

Seam to have some problems with the callbacks, there generating;

[06:36:56] Waiting for executable to start...
[07:36:56] Executable type: Windows - x86 (32bit)
[07:36:56] Executable started.
[07:36:56] [ERROR] purezipcallback.pb (Line: 26)
[07:36:56] [ERROR] Invalid memory access. (read error at address 2139095084)

And when I try thread safe it does this;

[06:37:21] The Program was killed.
[06:37:22] [COMPILER] Linker error!

POLINK: error: Unresolved external symbol '_PB_StringBasePosition'.
POLINK: Fatal error: 1 unresolved external(s).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Inner wrote:PB4.30, using your latest release posted above.
Seam to have some problems with the callbacks
Could you post some code ?
Inner wrote:And when I try thread safe it does this;
[06:37:21] The Program was killed.
[06:37:22] [COMPILER] Linker error!
POLINK: error: Unresolved external symbol '_PB_StringBasePosition'.
POLINK: Fatal error: 1 unresolved external(s).
Looks like a subsystem issue [did you enable SubSystems\UserLibThreadSafe ?].
The following example works in both standard and threadsafe modes.

Code: Select all

Procedure CB_COMP(FileName.s, Progression.f, Param.l)
  Debug FileName + ", " + StrF(Progression, 0) + ", " + Str(Param)
EndProcedure

PureZIP_SetCompressionCallback(@CB_COMP())

If PureZIP_Archive_Create("C:\purebasic430\program\test.zip", #APPEND_STATUS_CREATE)
  PureZIP_Archive_Compress(#PB_Compiler_Home + "Examples\Sources\2DDrawing.pb", #True, 1)
  PureZIP_Archive_Compress(#PB_Compiler_Home + "Examples\Sources\Arithmetic.pb", #True, 2)
  PureZIP_Archive_Compress(#PB_Compiler_Home + "Examples\Sources\AsmInline.pb", #True, 3)
  PureZIP_Archive_Close()
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post by Inner »

gnozal wrote:
Inner wrote:PB4.30, using your latest release posted above.
Seam to have some problems with the callbacks
Could you post some code ?
No need your fragment of code showed the error in my callbacks, something must have changed somewhere, I used to use;

PureZIP_CallbackC(File.s,PerCent.f)

with a "While WindowEvent() : Wend" in the callback, removing that and changing the procedure arguments too;

PureZIP_CallbackC(File.s,PerCent.f,Param.l)

Fixed the problem.
gnozal wrote:
Inner wrote:And when I try thread safe it does this;
[06:37:21] The Program was killed.
[06:37:22] [COMPILER] Linker error!
POLINK: error: Unresolved external symbol '_PB_StringBasePosition'.
POLINK: Fatal error: 1 unresolved external(s).
Looks like a subsystem issue [did you enable SubSystems\UserLibThreadSafe ?].
The following example works in both standard and threadsafe modes.

Code: Select all

Procedure CB_COMP(FileName.s, Progression.f, Param.l)
  Debug FileName + ", " + StrF(Progression, 0) + ", " + Str(Param)
EndProcedure

PureZIP_SetCompressionCallback(@CB_COMP())

If PureZIP_Archive_Create("C:\purebasic430\program\test.zip", #APPEND_STATUS_CREATE)
  PureZIP_Archive_Compress(#PB_Compiler_Home + "Examples\Sources\2DDrawing.pb", #True, 1)
  PureZIP_Archive_Compress(#PB_Compiler_Home + "Examples\Sources\Arithmetic.pb", #True, 2)
  PureZIP_Archive_Compress(#PB_Compiler_Home + "Examples\Sources\AsmInline.pb", #True, 3)
  PureZIP_Archive_Close()
EndIf
No I just enabled "Create threadsafe executable" from the compiler options.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Inner wrote:No need your fragment of code showed the error in my callbacks
Yes, the callback format changed in the latest download [additional UserParam]. See Tranquil's request.
Inner wrote:No I just enabled "Create threadsafe executable" from the compiler options.
Sorry, you need to enable the UserLibThreadSafe subsystem.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post by Inner »

gnozal wrote:
Inner wrote:No need your fragment of code showed the error in my callbacks
Yes, the callback format changed in the latest download [additional UserParam]. See Tranquil's request.
Inner wrote:No I just enabled "Create threadsafe executable" from the compiler options.
Sorry, you need to enable the UserLibThreadSafe subsystem.
Right'o np. thanks.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Does this lib also encompass the zip CRC capabilities?
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

SFSxOI wrote:Does this lib also encompass the zip CRC capabilities?
I don't know exactly what you mean ?
The ZIP files created with this library have a valid Crc32 stored, including crypted archives. This can be checked with any external archiver (WinRAR, 7-ZIP, etc....).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
besko
User
User
Posts: 42
Joined: Tue Oct 28, 2008 1:08 pm

Post by besko »

POLINK: error: Unresolved external symbol 'SYS_AllocateString'.
POLINK: fatal error: 1 unresolved external(s).

4.40 Beta 1
gnozal can you fix this error? please
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

I think a few of the libs are broken on 4.40, hopefully Gnozal will give us an update soon.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Because of
- Changed: Call(C)Function(Fast) parameters have been changed from 'Any' to 'Integer'.
I have to change my code to use prototypes.
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 »

Here a PureZIP V2 version compiled with PB4.40 BETA 1 : http://freenet-homepage.de/gnozal/PureZIP_440.zip

Please test.

Note : if you upgrade from PureZIP 1.xx, please note that PureZIP V2 requires an additional parameter for the compression and progression callbacks.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gtatVSS
New User
New User
Posts: 1
Joined: Sat Nov 21, 2009 11:41 am

Re: PureZIP library : ZIP / UNZIP files [password supported]

Post by gtatVSS »

Experimenting with PureZIP to unpack zip files, I find it runs in 1/3 the time MS Expand All takes (using 180MB zip file with many files). What is PureZip NOT doing and does it matter?

Secondly, my 3-line PureZIP unzipper app (simply calling PureZIP_ExtractFiles ) returns control to the WinXP command shell way before the files appear in the explorer or to the DIR command - do I need some sort of delay/wait in my app when I unzip a folder before I can see all the files in it?

Thirdly, can I use PureZip to unzip just a selected folder (e.g. with a filespec like "fred\innerFolder\things\*.jpg") ? I have a zip file with a complex internal folder hierarchy and I'm only interested in the content of a particular path. I suspect that PureZIP is so fast that this requirement is mostly irrelevant.

Thanks for PureZIP and PureBasic - at first sight it seems to be a dose of sanity in the increasingly complex and baffling software dev world. :D
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureZIP library : ZIP / UNZIP files [password supported]

Post by gnozal »

gtatVSS wrote:Experimenting with PureZIP to unpack zip files, I find it runs in 1/3 the time MS Expand All takes (using 180MB zip file with many files). What is PureZip NOT doing and does it matter?
I don't know what MS does ;-)
However PureZIP uses the ZLIB library so it should do what matters.
gtatVSS wrote:Secondly, my 3-line PureZIP unzipper app (simply calling PureZIP_ExtractFiles ) returns control to the WinXP command shell way before the files appear in the explorer or to the DIR command - do I need some sort of delay/wait in my app when I unzip a folder before I can see all the files in it?
I never use the MS explorer (I am totally addicted to Total Commander) so I can only guess : it's some refresh delay, which you can probably force by sending some message to the explorer.
gtatVSS wrote:Thirdly, can I use PureZip to unzip just a selected folder (e.g. with a filespec like "fred\innerFolder\things\*.jpg") ? I have a zip file with a complex internal folder hierarchy and I'm only interested in the content of a particular path. I suspect that PureZIP is so fast that this requirement is mostly irrelevant.
With the PureZIP_Archive_* functions, you can parse a ZIP archive (PureZIP_Archive_FindFirst()/PureZIP_Archive_FindNext()) and only extract some of the archived files (PureZIP_Archive_Extract()) based on the archived path (PureZIP_Archive_FileInfo()).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
zxtunes.com
Enthusiast
Enthusiast
Posts: 375
Joined: Wed Apr 23, 2008 7:51 am
Location: Saint-Petersburg, Russia
Contact:

Re: PureZIP library : ZIP / UNZIP files [password supported]

Post by zxtunes.com »

gnozal tell PureZip supports unpacking zip (RAW) archive without heading from memory
(1 file without zip a heading format)?
Post Reply