PureZIP library : ZIP / UNZIP files
Moderator: gnozal
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Just yesterday ts-soft hast a released a similar LIB like yours:gnozal wrote:It looks like a debugger issue !?
http://www.purebasic.fr/english/viewtopic.php?t=36420
I had the same problem with UseOGGSoundDecoder() but as you already mentioned it works if you turn off the debugger and remove all 'Debug' keywords. Now I tried the same with your LIB but I didn't work.
No, it doesn't. But I know why you assumed it works. You have tested your first example and not mine, right? It took me quite a while to figure it out but there is one more important thing:gnozal wrote:It works without it ...
If you you embed more than 1 file per IncludeBinary the ZIP-file has to be the last file.
Example #1: Working.
Code: Select all
DataSection
pblogo:
IncludeBinary #PB_Compiler_Home + "Examples\Sources\Data\PureBasicLogo.bmp"
geebee:
IncludeBinary #PB_Compiler_Home + "Examples\Sources\Data\Geebee2.bmp"
skybox:
IncludeBinary #PB_Compiler_Home + "Examples\Sources\Data\skybox.zip"
EndDataSection
Code: Select all
DataSection
pblogo:
IncludeBinary #PB_Compiler_Home + "Examples\Sources\Data\PureBasicLogo.bmp"
skybox:
IncludeBinary #PB_Compiler_Home + "Examples\Sources\Data\skybox.zip"
geebee:
IncludeBinary #PB_Compiler_Home + "Examples\Sources\Data\Geebee2.bmp"
EndDataSection
Other than that, it's working without a flaw.

+1X wrote:Any chance of a 64bit version of this ... ?

Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Yes.Fluid Byte wrote:... You have tested your first example and not mine, right?
This problem doesn't exist with PureLZMA, because you can read an archive directly from memory.
Code: Select all
DataSection
ArchiveBufferStart:
IncludeBinary "c:\purebasic430\program\MemArchiveTest.arc"
ArchiveBufferEnd:
EndDataSection
;
If PureLZMA_MemArchive_Read(?ArchiveBufferStart, ?ArchiveBufferEnd - ?ArchiveBufferStart)
Status = PureLZMA_MemArchive_FindFirst()
;
While Status
;
If PureLZMA_MemArchive_GetArchiveInfo(@ArchiveInfo.LZMA_ArchiveInfo)
Debug "----------------"
Debug "CRCUnpacked = $" + RSet(Hex(ArchiveInfo\CRCUnpacked, #PB_Long), 8, "0")
Debug "CRCPacked = $" + RSet(Hex(ArchiveInfo\CRCPacked, #PB_Long), 8, "0")
Debug "CRCPacked CALC = $" + RSet(Hex(PureLZMA_MemArchive_GetCRC(), #PB_Long), 8, "0")
Debug "LengthUnpacked = " + Str(ArchiveInfo\LengthUnpacked)
Debug "LengthPacked = " + Str(ArchiveInfo\LengthPacked) + " (" + StrF(ArchiveInfo\LengthPacked / ArchiveInfo\LengthUnpacked * 100, 2) + "% of original)"
Debug "LZMAFlags = " + Str(ArchiveInfo\LZMAFlags)
Debug "FileAttributes = $" + Hex(ArchiveInfo\FileAttributes)
Debug "Filename = '" + ArchiveInfo\Filename + "'"
EndIf
;
Status = PureLZMA_MemArchive_FindNext()
;
Wend
;
PureLZMA_MemArchive_Close()
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hi gnozal,
Please can you add a function like PureZip_Version$ to get the current
version of PureZIP ? I use the Menu-Entry 'More Infos' in one of my Tools
to get informations of used libraries and I miss a function like that.
BTW:
Do you plan to re-adding support for add empty directorys to zip ?
In my filemanager I can't no longer use the 'MakeDirectory_to_Zip'
function.
Please can you add a function like PureZip_Version$ to get the current
version of PureZIP ? I use the Menu-Entry 'More Infos' in one of my Tools
to get informations of used libraries and I miss a function like that.
BTW:
Do you plan to re-adding support for add empty directorys to zip ?
In my filemanager I can't no longer use the 'MakeDirectory_to_Zip'
function.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Update (all versions)
Changes :
- new function : PureZIP_Archive_GlobalComment()
- new function : PureZIP_GetVersion()
- fixed broken #PureZIP_RecursiveZeroDirs in PureZIP_AddFiles()
Changes :
- new function : PureZIP_Archive_GlobalComment()
- new function : PureZIP_GetVersion()
- fixed broken #PureZIP_RecursiveZeroDirs in PureZIP_AddFiles()
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:
Afaik, ZLIB does not offer any function to delete a file from an archive.Tranquil wrote:Is it possible to remove Files/ Folders from an Archive?
I suppose one could do it using the 'raw' functions, but I didn't try.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hi gnozal,
at first, thank you for this great lib. I use it in a project to compress files using
Now, another one needs to decompress the file using ZLIB functions on Java ME. But he is not able to do so (errors). Can you please give me some information about the algorithm and parameters you use in ZLIB for compression in PureZIP? Is it possible to get the part of code for this call to ZLIB with the corresponding parameters and values?
Or can you tell me the exact ZLIB call to decompress such a file?
Maybe this can help him...
Thank you,
Kukulkan
at first, thank you for this great lib. I use it in a project to compress files using
Code: Select all
PureZIP_AddFile(ZIPFilename.s, OriginalFilename.s, 0)
Or can you tell me the exact ZLIB call to decompress such a file?
Maybe this can help him...
Thank you,
Kukulkan
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I use this ZLIB version : http://www.winimage.com/zLibDll/ ; it has some 'PKZIP high level' functions. The ZLIB version available at www.zlib.net doesn't.Kukulkan wrote:Can you please give me some information about the algorithm and parameters you use in ZLIB for compression in PureZIP? Is it possible to get the part of code for this call to ZLIB with the corresponding parameters and values?
I use the #Z_BEST_COMPRESSION compression flag.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Okay, back again and still working on ZIP Archive support for my filemanager using your great lib.
Just one little question again:
As it is not possible to remove/ delete a file/directory directly from the archive it is necessary to re-compress the whole archive. This could be speed up a bit if it would be possible to extract an already compressed file and put this to archive again without the need of compressing it again.
This could be something like: PureZIP_GetFile() and PureZIP_PutFile().
Maybe this is possible?
Just one little question again:
As it is not possible to remove/ delete a file/directory directly from the archive it is necessary to re-compress the whole archive. This could be speed up a bit if it would be possible to extract an already compressed file and put this to archive again without the need of compressing it again.
This could be something like: PureZIP_GetFile() and PureZIP_PutFile().
Maybe this is possible?
Tranquil
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
This is what I do with PureLZMA-Packer.Tranquil wrote:As it is not possible to remove/ delete a file/directory directly from the archive it is necessary to re-compress the whole archive. This could be speed up a bit if it would be possible to extract an already compressed file and put this to archive again without the need of compressing it again.
It should be possible using the ZLIB 'raw' functions ; but I have no experience here. Maybe I will have a closer look when I have some time.Tranquil wrote:Maybe this is possible?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Not so loud
all fully compatiblen ZIP.DLL does not produce archives over 2GB
all fully compatiblen ZIP.DLL does not produce archives over 2GB
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
besko wrote:gnozal are you test this lib with files size more then 6gb?
not working for me (
ZLIB doesn't support files > 4 GBPureZIP.CHM wrote:ZLIB can handle files up to 4 Gbytes, but PB longs are signed [0 - 2 Gbytes]...
So if you expect PureZIP_FileInfo\CompressedSize > 2 Gbytes or PureZIP_FileInfo\unCompressedSize > 2 Gbytes,
use quads and convert signed to unsigned !
Example : Size.q = FileInfo\unCompressedSize & $FFFFFFFF
I don't understand what you mean.besko wrote:And how i can pack files in folder if i want pack custom files to different zip files.
If the 'high level' functions like PureZIP_AddFiles() don't provide the functionality you need, use the 'low level' functions [PureZIP_Archive_*()].
Finally, you could try MiniZIP.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).