It's the DLL from WinImage (link in my previous post) transformed to a static library. But I've also used the regular static lib from WinImage, and it works likewise (in PureZIP).fizban wrote:You must have done something additional. I couldn't find a lib that worked with PB there. Besides, there are some references to purezip inside your lib...
PureZIP library : ZIP / UNZIP files
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
It is, but probably not for all DLLs. And there might be some big dependancy problems.fizban wrote:Oh. I didn't know that was possible.
I didn't.fizban wrote:How did you transform the dll into a lib?
A friend of mine is a developer and has such tools (DLL2LIB I believe ?).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
If it is dll2lib, looking at their license statement, "BSI grants you a non-exclusive royalty-free right to compile, reproduce and distribute the static libraries, DLLs, components, header files, source files (the "REDISTRIBUTABLES") or new software programs created using THE SOFTWARE".
So, my interpretation is that it safe to use this lib commercially, licensewise.
So, my interpretation is that it safe to use this lib commercially, licensewise.
Just in case, I downloaded Visual C++ Express 2005 and the platform SDK 2008 and I rebuilt zlibstat.lib. It was easier than I expected. The worst thing was downloading all those megs just to compile this small library. The resulting lib is larger than yours, though, but a little bit smaller than the one at winimage. Using this new zlibstat I get a smaller executable than with yours. It might be related to the dll to lib conversion... I can send it to you if you want so that you can make it available to others...
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
That would be nice, thanks.fizban wrote:I can send it to you if you want so that you can make it available to others...
[EDIT] Got it, thanks. See my PM.
Last edited by gnozal on Tue Aug 26, 2008 1:25 pm, edited 1 time in total.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Exceptions on AddFiles
Hi, gnozal,
I'm using PureZip_AddFiles command with #PureZIP_Recursive flag activated.
On "FileMask" parameter I need to specify some mask to not add "*.pst" files (they are very big). Is possible that mask?.
Yes. I can make ExamineDirectory() and then PureZIP_AddFile for every entry (except pst files), I know that, but #PureZIP_Recursive is very useful.
I'm using PureZip_AddFiles command with #PureZIP_Recursive flag activated.
On "FileMask" parameter I need to specify some mask to not add "*.pst" files (they are very big). Is possible that mask?.
Yes. I can make ExamineDirectory() and then PureZIP_AddFile for every entry (except pst files), I know that, but #PureZIP_Recursive is very useful.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: Exceptions on AddFiles
Sorry, you can't do that. PureZip_AddFiles() is only a convenient wrapper to the PureZIP_Archive_*() functions.graves wrote:On "FileMask" parameter I need to specify some mask to not add "*.pst" files (they are very big). Is possible that mask?.
My advise is to scan the directory using ExamineDirectory() and archive the files you need using the PureZIP_Archive_*() functions.
Something like this (not tested, but you get the idea) :
Code: Select all
Global NewList FileList.s()
Procedure DirectoryListing(Recursive.l, Directory.s)
Protected MyDir.l, FullFileName.s, FileName.s
MyDir = ExamineDirectory(#PB_Any, Directory, "*.*")
If MyDir
Repeat
If NextDirectoryEntry(MyDir) = 0
Break
EndIf
FileName = DirectoryEntryName(MyDir)
If Right(Directory, 1) <> ""
Directory = Directory + ""
EndIf
FullFileName = Directory + FileName
If DirectoryEntryType(MyDir) = #PB_DirectoryEntry_Directory And Recursive
If FileName <> "." And FileName <> ".."
DirectoryListing(Recursive, Directory + FileName)
EndIf
ElseIf DirectoryEntryType(MyDir) = #PB_DirectoryEntry_File
If LCase(GetExtensionPart(FileName)) <> "pst"
AddElement(FileList())
FileList() = FullFileName
EndIf
EndIf
ForEver
FinishDirectory(MyDir)
EndIf
EndProcedure
DirectoryListing(#True, "c:\MyTestDir")
If CountList(FileList())
If PureZIP_Archive_Create("MyZIP", #APPEND_STATUS_CREATE)
ForEach FileList()
PureZIP_Archive_Compress(FileList(), #True)
Next
PureZIP_Archive_Close()
EndIf
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Hi
YesKukulkan wrote:Is it possible to decompress data, compressed using PureZIP library, directly by using ZLIB functions?
No.Kukulkan wrote:Or is there a special header added to PureZIP compressed data?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
What ZLIB functions do you use ?Kukulkan wrote:If I try to use ZLIB to decompress, it tells me that the data was corrupt!
Note that you have to use ZIP compatible functions like unzOpen() - unzGoToFirstFile() etc ...
The 'PK' header is the classic PKZIP header. It has nothing to do with ZLIB.Kukulkan wrote: The header starts with PK, but is this for ZLIB compression?
I meant PureZIP doesn't add any extra header.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hi Gnozal,
My current problem is, that I decrypt some previous zip compressed file into memory. Now I need to unzip the data in memory, but PureZIP does not offer a function to unzip a ZIP file that is located in memory. Currently I solve this by storing the content temporarely on disk to use PureZIP_ExtractFile() function. But this is not a good solution. I need some PureZIP_ExtractFileFromMemory() function. By the way, a corresponding PureZIP_AddFileToMemory() function will be great, too.
To clearify: The memory content is a ZIP file in memory (PK...). The PureZIP_PackMemory() and PureZIP_UnpackMemory() functions do not work with ZIP-file in memory (it is DEFLATE compressed?).
My Idea has been to use another ZLIB library, but this one is not able to use a ZIP-file in memory, too
Kukulkan
My current problem is, that I decrypt some previous zip compressed file into memory. Now I need to unzip the data in memory, but PureZIP does not offer a function to unzip a ZIP file that is located in memory. Currently I solve this by storing the content temporarely on disk to use PureZIP_ExtractFile() function. But this is not a good solution. I need some PureZIP_ExtractFileFromMemory() function. By the way, a corresponding PureZIP_AddFileToMemory() function will be great, too.
To clearify: The memory content is a ZIP file in memory (PK...). The PureZIP_PackMemory() and PureZIP_UnpackMemory() functions do not work with ZIP-file in memory (it is DEFLATE compressed?).
My Idea has been to use another ZLIB library, but this one is not able to use a ZIP-file in memory, too

Kukulkan
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
AFAIK, the ZLIB ZIP compatible functions only allow to open an archive from disk, not from memory : I don't know a function like unzOpen() for a memory bank.Kukulkan wrote:To clearify: The memory content is a ZIP file in memory (PK...). The PureZIP_PackMemory() and PureZIP_UnpackMemory() functions do not work with ZIP-file in memory (it is DEFLATE compressed?).
It is certainly possible using some ZLIB base functions like deflate(), but you'll have to manage all the header stuff manually. I never tried that, sorry.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).