Page 38 of 40

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Tue Jan 11, 2011 10:46 am
by gnozal
Starwolf20 wrote:Hi Gnozal
The 1er post says that PureZip uses Zlib V1.23.
The ZLIB website says that the last version is V1.25. Is an update of PureZip planned ?
Thanks
Hi,
Sometimes ago I tried to update PureZIP with the static library from Gilles Vollant's site, but I didn't manage to use it with PB, because of linker errors iirc.

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Sat Apr 02, 2011 10:22 pm
by User_Russian
How can I add to ZIP Archive, an empty folder (which does not contain any files) by using the PureZIP_Archive_Compress?

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Wed Apr 13, 2011 9:27 am
by gnozal
User_Russian wrote:How can I add to ZIP Archive, an empty folder (which does not contain any files) by using the PureZIP_Archive_Compress?
You can't !

However, you may use PureZIP_AddFiles() with #PureZIP_RecursiveZeroDirs flag to store empty folders.
But do not use this function within a PureZIP_Archive_Create() / PureZIP_Archive_Close() sequence.

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Wed Apr 20, 2011 7:28 pm
by User_Russian
gnozal wrote:
User_Russian wrote:How can I add to ZIP Archive, an empty folder (which does not contain any files) by using the PureZIP_Archive_Compress?
You can't !

However, you may use PureZIP_AddFiles() with #PureZIP_RecursiveZeroDirs flag to store empty folders.
But do not use this function within a PureZIP_Archive_Create() / PureZIP_Archive_Close() sequence.
I create self-extracting (SFX) archive, using

Code: Select all

PureZIP_Archive_Create(ArchiveFileName.s, #APPEND_STATUS_CREATEAFTER)
Therefore, the function PureZIP_AddFiles () can not be used.
What should do?

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Thu Apr 21, 2011 11:02 am
by gnozal
User_Russian wrote:I create self-extracting (SFX) archive, using

Code: Select all

PureZIP_Archive_Create(ArchiveFileName.s, #APPEND_STATUS_CREATEAFTER).
Therefore, the function PureZIP_AddFiles () can not be used.
What should do?[/quote]
You can create the archive ("archive.zip") and then add the sfx stub ("archive.sfx").

You may use the console (COPY /B archive.sfx+archive.zip archive.exe) or purebasic's file functions.

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Wed Jul 13, 2011 2:28 pm
by gnozal
Update (PB4.60 version)

Changes :
  - new function : PureZIP_DeleteFile(Archive.s, FileToDelete.s)
  - new function : PureZIP_RenameFile(Archive.s, OldFileName.s, NewFileName.s)

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Tue Jul 19, 2011 2:26 pm
by besko
Gnozal, what about archive size ? Can we rise these nums?

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Tue Jul 19, 2011 3:03 pm
by gnozal
besko wrote:Gnozal, what about archive size ? Can we rise these nums?
PureZIP (ZLIB) should support archive sizes up to 2GB.
However I wouldn't use ZIP for big archives, because :
- some compressors achieve much better compression ratio (RAR, 7-ZIP, ...)
- ZIP doesn't have recovery capabilities like RAR for example

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Fri Jul 22, 2011 5:26 pm
by c4s
Hi Gnozal, I have two questions:

Is it possible to set the compression level and if not could you please add it?

Also you wrote somewhere that Unicode isn't properly supported. What does that exactly mean?

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Sat Jul 23, 2011 8:30 am
by gnozal
c4s wrote:Is it possible to set the compression level and if not could you please add it?
You may use PureZIP_SetCompressionAlgorithm() to choose between #Z_NO_COMPRESSION and #Z_DEFLATED.
As #Z_DEFLATED is so fast, PureZIP always uses #Z_BEST_COMPRESSION. There is no point using any other compression level.
c4s wrote:Also you wrote somewhere that Unicode isn't properly supported. What does that exactly mean?
In a (PKZIP 2.04g) ZIP archive, the filenames are stored as OEM (MS-DOS, remember ?). ZLIB does not support the unicode extensions, and every packer has another method to store unicode file names (unicode filenames as UTF-8 : Pkzip 4.5/Winzip 11.2 method, unicode filename in extra field : Info-Zip method, etc...).

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Sat Jul 23, 2011 9:44 am
by c4s
gnozal wrote:You may use PureZIP_SetCompressionAlgorithm() to choose between #Z_NO_COMPRESSION and #Z_DEFLATED.
As #Z_DEFLATED is so fast, PureZIP always uses #Z_BEST_COMPRESSION. There is no point using any other compression level.
Users (!) sometimes like to have control over something, even if it doesn't make sense in a programmers point of view. Please just add it to PureZIP_SetCompressionAlgorithm()... I would highly appreciate it!
gnozal wrote:In a (PKZIP 2.04g) ZIP archive, the filenames are stored as OEM (MS-DOS, remember ?). ZLIB does not support the unicode extensions, and every packer has another method to store unicode file names (unicode filenames as UTF-8 : Pkzip 4.5/Winzip 11.2 method, unicode filename in extra field : Info-Zip method, etc...).
OK, but what does that mean for PureZIP? Is Unicode supported in some way?

As far as I remember Microsoft added Zip support to the Windows Explorer in XP. Was it possible to create Zip folders as well? If so, do you know how they managed this issue?

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Sat Jul 23, 2011 10:39 am
by gnozal
c4s wrote:Users (!) sometimes like to have control over something, even if it doesn't make sense in a programmers point of view. Please just add it to PureZIP_SetCompressionAlgorithm()... I would highly appreciate it!
If you open a ZIP file with 7-ZIP and check the properties, you only get the algorithm (Deflate), but not the compression level. And if you want to create a ZIP file, you have 6 generic compression level options that do not have any meaning, as DEFLATE only has 2 levels (Z_BEST_SPEED and Z_BEST_COMPRESSION)!

So if the user is pleased with meaningless options, just add a trackbar that does nothing... as only 2 options may no satisfy him !

Anyway, I may add PureZIP_SetCompressionLevel() in a future version ... to please my users !
c4s wrote:OK, but what does that mean for PureZIP? Is Unicode supported in some way?
The unicode version of PureZIP translates unicode to OEM and vice-versa. It works, but it is not 'true' unicode support...
c4s wrote:As far as I remember Microsoft added Zip support to the Windows Explorer in XP. Was it possible to create Zip folders as well? If so, do you know how they managed this issue?
I have no idea. I only know that the genuine PKZIP 2.04g archive format does not support unicode, and that some modern archivers use a workaround to store unicode filenames (see my previous post).

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Sat Jul 23, 2011 12:20 pm
by c4s
gnozal wrote:If you open a ZIP file with 7-ZIP and check the properties, you only get the algorithm (Deflate), but not the compression level. And if you want to create a ZIP file, you have 6 generic compression level options that do not have any meaning, as DEFLATE only has 2 levels (Z_BEST_SPEED and Z_BEST_COMPRESSION)!

So if the user is pleased with meaningless options, just add a trackbar that does nothing... as only 2 options may no satisfy him !
Wikipedia about Deflate says: "Options range from -0 (do not attempt compression, just store uncompressed) to -9 representing the maximum capability of the reference implementation in zlib/gzip."
gnozal wrote:Anyway, I may add PureZIP_SetCompressionLevel() in a future version ... to please my users !
I case it's not meant ironically, thank you. ;-)
gnozal wrote:The unicode version of PureZIP translates unicode to OEM and vice-versa. It works, but it is not 'true' unicode support...
Thanks for explaining!

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Mon Jul 25, 2011 7:53 am
by gnozal
c4s wrote:Wikipedia about Deflate says: "Options range from -0 (do not attempt compression, just store uncompressed) to -9 representing the maximum capability of the reference implementation in zlib/gzip."
There are two constants, #Z_BEST_SPEED = 1 and #Z_BEST_COMPRESSION = 9, so I guess values 2-8 are valid, never tried it though.
Anyway, it's the same problem : 9 ZLIB values, 6 compression level options in 7-ZIP, so no match between user input and ZLIB function reality.
c4s wrote:I case it's not meant ironically, thank you.
See below..

Re: PureZIP library : ZIP / UNZIP files [password supported]

Posted: Mon Jul 25, 2011 8:40 am
by gnozal
Update (PB4.60 version)

Changes :
- new function : PureZIP_SetCompressionLevel()