Page 10 of 40

Posted: Sat Jul 08, 2006 9:11 am
by gnozal
Update (both libs)

Changes :
- use option #PureZIP_RecursiveZeroDirs to add empty directories to archive (workaround).
(option #PureZIP_Recursive doesn't do it anymore)

See http://www.purebasic.fr/english/viewtopic.php?t=22607

Posted: Mon Jul 10, 2006 7:37 am
by gnozal
Update (both libs)

Changes :
- fixed help file (was wrong version, sorry)

Posted: Sun Jul 16, 2006 10:41 pm
by Thorsten1867
How can I overwrite a file in the zip?

My problem:
- I extract one file from the zip
- I work with it and change it
- I add the changed file to the zip

But, then it seems, I have the file two times in the zip and next time three times and so on.

Posted: Mon Jul 17, 2006 8:40 am
by gnozal
Thorsten1867 wrote:How can I overwrite a file in the zip?

My problem:
- I extract one file from the zip
- I work with it and change it
- I add the changed file to the zip

But, then it seems, I have the file two times in the zip and next time three times and so on.
You can't : ZLIB does not provide any function to delete / update a file in an archive.
You could :
- use the ZLIB 'raw' functions
or
- extract the files you want to keep, erase and rebuild the archive

Posted: Wed Jul 19, 2006 5:29 am
by yoxola
When I tried PureZIP for 4.0, I found the examples aren't updated to PB4 syntax and I go this:

PureZIP_SetCallack() is not a function, array, macro or linked list.

I have no clue about what it is :|

Posted: Wed Jul 19, 2006 7:50 am
by gnozal
yoxola wrote:When I tried PureZIP for 4.0, I found the examples aren't updated to PB4 syntax and I go this:

PureZIP_SetCallack() is not a function, array, macro or linked list.

I have no clue about what it is :|
Yes, you are right : 2 examples were not updated. It is fixed now (please download again).

About the callback :
Old function PureZIP_SetCallback() was renamed to PureZIP_SetProgressionCallback(), and there is a new function PureZIP_SetCompressionCallback().
PureZIP_SetProgressionCallback() wrote:Set PureZIP progression callback address for the functions :
- PureZIP_ExtractFiles()
- PureZIP_AddFiles()
The callback is called each time a new file is processed.
Usefull to indicate the progress when many files are packed / unpacked.
PureZIP_SetCompressionCallback() wrote:Set PureZIP (de)compression callback address for the functions :
- PureZIP_Archive_Compress()
- PureZIP_Archive_Extract()
- PureZIP_ExtractFile()
- PureZIP_AddFile()
- PureZIP_ExtractFiles()
- PureZIP_AddFiles()
The callback is called in realtime during compression or decompression.
Usefull to indicate the progress when a big file is packed / unpacked.
See the new MiniZIP/MiniUNZIP sources for an example using both callbacks.

Posted: Wed Jul 19, 2006 11:12 am
by yoxola
Thanks, it works now :)

Blame me, I should read the document when stuck....
I didn't notice the change.

Great thanks , this lib is pretty useful :)

Posted: Wed Jul 19, 2006 2:00 pm
by Kiffi
Hello gnozal,

i try to test your lib with a 300 MB-Zip containing a single 2.2 GB-File. The
ZIP-File is correct (tested with WinZip) and there is enough space on my
harddisk but the Returnvalue of PureZIP_ExtractFiles is always #False.

Is there a restriction on files greater 2 GBs?

Thanks in advance & Greetings ... Kiffi

Posted: Wed Jul 19, 2006 5:35 pm
by gnozal
Kiffi wrote:Hello gnozal,

i try to test your lib with a 300 MB-Zip containing a single 2.2 GB-File. The
ZIP-File is correct (tested with WinZip) and there is enough space on my
harddisk but the Returnvalue of PureZIP_ExtractFiles is always #False.

Is there a restriction on files greater 2 GBs?

Thanks in advance & Greetings ... Kiffi
Hmm, I don't know what the ZLIB (from http://www.winimage.com/zLibDll/) limit is ...
PureZIP_ExtractFiles() returns #False if one of the involved ZLIB functions like unzOpen() fails, or if no file in the archive matches with the filemask.
Maybe you could try to unpack this file with the PureZIP_Archive_* functions ?

Note that ZLIB does not support the 'new' WinZIP compression algorithm PPMd.

Posted: Fri Jul 21, 2006 11:16 am
by Kiffi
> Maybe you could try to unpack this file with the PureZIP_Archive_*
> functions ?

yes, i can read the content of the zip-file with PureZIP_Archive_Read() and
PureZIP_GetFileInfo(), but the uncompressed size is wrong (i think, this is the
reason why i cannot extract the file(?)).

Image

// Edit:
zlib_faq wrote:# Can zlib work with greater than 4 GB of data?

Yes. inflate() and deflate() will process any amount of data correctly. Each
call of inflate() or deflate() is limited to input and output chunks of the
maximum value that can be stored in the compiler's "unsigned int" type,
but there is no limit to the number of chunks. Note however that the
strm.total_in and strm_total_out counters may be limited to 4 GB. These
counters are provided as a convenience and are not used internally by
inflate() or deflate(). The application can easily set up its own counters
updated after each call of inflate() or deflate() to count beyond 4 GB.
compress() and uncompress() may be limited to 4 GB, since they operate
in a single call. gzseek() and gztell() may be limited to 4 GB depending on
how zlib is compiled. See the zlibCompileFlags() function in zlib.h.

The word "may" appears several times above since there is a 4 GB limit
only if the compiler's long type is 32 bits. If the compiler's long type is 64
bits, then the limit is 16 exabytes.
http://www.zlib.net/zlib_faq.html#faq32

Greetings ... Kiffi

Posted: Fri Jul 21, 2006 3:08 pm
by gnozal
Purebasic longs are signed [range : 0 - 2GB], so FileInfo\unCompressedSize is negative !
And I am verifying if FileInfo\unCompressedSize >= 0 ....

I have removed the test in this beta lib : http://people.freenet.de/gnozal/PureZIP_BETA.zip
Could you try it ?

REM : Of course the progression in PureZIP_SetCompressionCallback() will be false !

Posted: Fri Jul 21, 2006 4:22 pm
by Kiffi
gnozal wrote:Purebasic longs are signed [range : 0 - 2GB], so FileInfo\unCompressedSize is negative !
so now with PB4 you can use Quads ;-)
gnozal wrote:Could you try it ?
now the file was extracted correctly :D
gnozal wrote:REM : Of course the progression in PureZIP_SetCompressionCallback() will be false !
yes, that's a pitty, because my progressbar doesn't work anymore :cry:

Thank you for your help!

Greetings ... Kiffi

Posted: Fri Jul 21, 2006 4:26 pm
by gnozal
Kiffi wrote:
gnozal wrote:Purebasic longs are signed [range : 0 - 2GB], so FileInfo\unCompressedSize is negative !
so now with PB4 you can use Quads ;-)
Yes, I think I will update the PB4.00 lib using quads.
Kiffi wrote:
gnozal wrote:Could you try it ?
now the file was extracted correctly :D
:D
Kiffi wrote:
gnozal wrote:REM : Of course the progression in PureZIP_SetCompressionCallback() will be false !
yes, that's a pitty, because my progressbar doesn't work anymore :cry:
It should be OK if I use quads.

Posted: Fri Jul 21, 2006 4:46 pm
by gnozal
I have added quads in this beta lib : http://people.freenet.de/gnozal/PureZIP_BETA.zip [Not tested]
Could you try it ?

It should :
- accept files up to 4 GB
- display correct progression for files > 2 GB

Posted: Fri Jul 21, 2006 6:26 pm
by Kiffi
gnozal wrote:Could you try it ?
sorry, same behaviour as before: PureZIP_ExtractFiles returns #Null and the
uncompressed filesize is negative.

Greetings ... Kiffi