Page 33 of 40

Posted: Wed Feb 18, 2009 6:08 pm
by X
Any chance of a 64bit version of this ... ?

Posted: Wed Feb 18, 2009 6:35 pm
by Fluid Byte
gnozal wrote:It looks like a debugger issue !?
Just yesterday ts-soft hast a released a similar LIB like yours:

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.
gnozal wrote:It works without it ... :shock:
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:

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
Example #2: Fails.

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
But again, this is only important if you have UseOGGSoundDecoder() in your source.

Other than that, it's working without a flaw. :o
X wrote:Any chance of a 64bit version of this ... ?
+1 :P

Posted: Thu Feb 19, 2009 9:03 am
by gnozal
Fluid Byte wrote:... You have tested your first example and not mine, right?
Yes.
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

Posted: Tue Feb 24, 2009 9:10 pm
by AL90
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.

Posted: Wed Feb 25, 2009 12:27 pm
by gnozal
Update (all versions)

Changes :
- new function : PureZIP_Archive_GlobalComment()
- new function : PureZIP_GetVersion()
- fixed broken #PureZIP_RecursiveZeroDirs in PureZIP_AddFiles()

Posted: Wed Feb 25, 2009 4:42 pm
by AL90
This was very fast, thanks gnozal. :D

Posted: Tue Mar 10, 2009 2:16 am
by Tranquil
Just wanted to shout a big Thanks to this great lib!

But one question anyway:

Is it possible to remove Files/ Folders from an Archive?

Posted: Tue Mar 10, 2009 8:39 am
by gnozal
Tranquil wrote:Is it possible to remove Files/ Folders from an Archive?
Afaik, ZLIB does not offer any function to delete a file from an archive.
I suppose one could do it using the 'raw' functions, but I didn't try.

Posted: Wed Mar 11, 2009 9:56 am
by Kukulkan
Hi gnozal,

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)
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

Posted: Wed Mar 11, 2009 11:16 am
by gnozal
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 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.
I use the #Z_BEST_COMPRESSION compression flag.

Posted: Fri Mar 13, 2009 3:56 am
by Tranquil
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?

Posted: Fri Mar 13, 2009 9:28 am
by gnozal
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.
This is what I do with PureLZMA-Packer.
Tranquil wrote:Maybe this is possible?
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.

Posted: Sun Apr 05, 2009 9:31 pm
by besko
gnozal are you test this lib with files size more then 6gb?
not working for me (

And how i can pack files in folder if i want pack custom files to different zip files.
Example:
Folder -My Files/
/photo1.jpg
/money.doc
/etc.

i want to get
/photo1.zip
/money.zip

:)

Posted: Sun Apr 05, 2009 9:55 pm
by mk-soft
Not so loud

all fully compatiblen ZIP.DLL does not produce archives over 2GB

Posted: Mon Apr 06, 2009 7:53 am
by gnozal
besko wrote:gnozal are you test this lib with files size more then 6gb?
not working for me (
PureZIP.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
ZLIB doesn't support files > 4 GB
besko wrote:And how i can pack files in folder if i want pack custom files to different zip files.
I don't understand what you mean.
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.