Page 29 of 40
Posted: Mon Aug 25, 2008 11:54 am
by gnozal
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...
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).
Posted: Mon Aug 25, 2008 12:26 pm
by fizban
Oh. I didn't know that was possible. How did you transform the dll into a lib? I have googled it and only found a $999 tool and a free python script...
Posted: Mon Aug 25, 2008 12:33 pm
by gnozal
fizban wrote:Oh. I didn't know that was possible.
It is, but probably not for all DLLs. And there might be some big dependancy problems.
fizban wrote:How did you transform the dll into a lib?
I didn't.
A friend of mine is a developer and has such tools (DLL2LIB I believe ?).
Posted: Mon Aug 25, 2008 1:13 pm
by fizban
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.
Posted: Mon Aug 25, 2008 8:02 pm
by fizban
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...
Posted: Tue Aug 26, 2008 7:28 am
by gnozal
fizban wrote:I can send it to you if you want so that you can make it available to others...
That would be nice, thanks.
[EDIT] Got it, thanks. See my PM.
Exceptions on AddFiles
Posted: Tue Aug 26, 2008 12:44 pm
by graves
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.
Re: Exceptions on AddFiles
Posted: Tue Aug 26, 2008 1:39 pm
by gnozal
graves wrote:On "FileMask" parameter I need to specify some mask to not add "*.pst" files (they are very big). Is possible that mask?.
Sorry, you can't do that. PureZip_AddFiles() is only a convenient wrapper to the PureZIP_Archive_*() functions.
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
Posted: Wed Sep 17, 2008 3:40 pm
by Kukulkan
Hi Gnozal,
Is it possible to decompress data, compressed using PureZIP library, directly bu using ZLIB functions? Or is there a special header added to PureZIP compressed data? How to manage?
Kukulkan
Posted: Wed Sep 17, 2008 3:44 pm
by gnozal
Hi
Kukulkan wrote:Is it possible to decompress data, compressed using PureZIP library, directly by using ZLIB functions?
Yes
Kukulkan wrote:Or is there a special header added to PureZIP compressed data?
No.
Posted: Wed Sep 17, 2008 4:06 pm
by Kukulkan
Hi,
I have a file that was packed using PureZIP. I can decompress it with WinZIP or RAR and it works great.
If I try to use ZLIB to decompress, it tells me that the data was corrupt! The header starts with PK, but is this for ZLIB compression?
Kukulkan
Posted: Wed Sep 17, 2008 4:15 pm
by gnozal
Kukulkan wrote:If I try to use ZLIB to decompress, it tells me that the data was corrupt!
What ZLIB functions do you use ?
Note that you have to use ZIP compatible functions like unzOpen() - unzGoToFirstFile() etc ...
Kukulkan wrote: The header starts with PK, but is this for ZLIB compression?
The 'PK' header is the classic PKZIP header. It has nothing to do with ZLIB.
I meant PureZIP doesn't add any extra header.
Posted: Thu Sep 18, 2008 10:32 am
by Kukulkan
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
Posted: Thu Sep 18, 2008 11:11 am
by gnozal
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?).
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.
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.
Posted: Thu Oct 02, 2008 1:11 am
by Inner
4.30 beta 2 & 3 of Purebasic reports;
The following PureLibrary is missing: StringExtension