Page 13 of 40
Posted: Sun Nov 26, 2006 9:40 pm
by AL90
Some Questions
1) How I can Create a Directory into the Archive ?
2) How I can Delete a File or Dir from Archive ?
3) How I can Add a File to a specified Folder into Archive ?
3) e.g.
C:\TestFolder\MyProg.exe ----> ZIP:\OtherFolder\Here\MyProg.exe
Or have I oversee some features ? I want use your lib in my current
project FileMaster (a Total-Commander Clone) and it works
fine. but I have some problems (commented on Top)
I missing a Destination$ for AddFile(s) and so on.
Posted: Mon Nov 27, 2006 9:08 am
by gnozal
AL90 wrote:1) How I can Create a Directory into the Archive ?
You can't. I am not sure this is possible with the ZLIB functions I use (zipOpenNewFileInZip / zipWriteInFileInZip).
AL90 wrote:2) How I can Delete a File or Dir from Archive ?
You can't. ZLIB doesn't provide any function to do this. You have to recreate the archive.
AL90 wrote:3) How I can Add a File to a specified Folder into Archive ?
You can't. I am not sure this is possible with the ZLIB functions I use (zipOpenNewFileInZip / zipWriteInFileInZip).
FYI, I use this ZLIB package :
http://www.winimage.com/zLibDll/
There are other libraries you could use like InfoZIP :
http://www.info-zip.org/
Posted: Mon Nov 27, 2006 6:48 pm
by AL90
Ok I will use for the first time only the DeCompress Funktions of your Lib.
Later I will check another solutions. Thanks for your post and the Links.

Posted: Wed Nov 29, 2006 1:22 pm
by gnozal
PureZIP 1.70 BETA
Added UNICODE support.
Much code has changed, so it's a beta release.
Please test (ANSI
and UNICODE) and report any bugs.
Thanks.
Download the beta here :
http://people.freenet.de/gnozal/PureZIP_BETA.zip
Posted: Sun Dec 03, 2006 12:55 pm
by mk-soft
PureZIP 1.60
Hi,
I have follow probleme. When i Addfiles(...) with PureZIP_Recursive than have the archiv a folder entry and a file entry to the folder. That is not right.
My system is XP-Home
Thanks
Nice Day

Posted: Mon Dec 04, 2006 9:05 am
by gnozal
mk-soft wrote:PureZIP 1.60
I have follow probleme. When i Addfiles(...) with PureZIP_Recursive than have the archiv a folder entry and a file entry to the folder. That is not right.
Do you use #PureZIP_RecursiveZeroDirs or #PureZIP_Recursive ?
#PureZIP_Recursive : only files entries
Code: Select all
myFileinfo.PureZIP_FileInfo
PureZIP_AddFiles("c:\PureBasic400\Program\!!!.zip", "c:\PureBasic400\Program\PurePOP3_Debugfile\*.*" , #True, #PureZIP_Recursive)
If PureZIP_Archive_Read("c:\PureBasic400\Program\!!!.zip")
ReturnValue.l = PureZIP_Archive_FindFirst() = #UNZ_OK
While ReturnValue = #UNZ_OK
Debug PureZIP_Archive_FileInfo(@myFileinfo)
Debug "Filename: " + myFileinfo\FileName
Debug "Compressed Size: " + Str(myFileinfo\CompressedSize)
Debug "Uncompressed Size: "+ Str(myFileinfo\unCompressedSize)
ReturnValue.l = PureZIP_Archive_FindNext()
Wend
PureZIP_Archive_Close()
EndIf
0
Filename: c:\PureBasic400\Program\PurePOP3_Debugfile\In_00001.mai
Compressed Size: 810
Uncompressed Size: 1950
0
Filename: c:\PureBasic400\Program\PurePOP3_Debugfile\PurePOP3-DEBUG-COM.txt
Compressed Size: 979
Uncompressed Size: 2384
0
Filename: c:\PureBasic400\Program\PurePOP3_Debugfile\PurePOP3-DEBUG-RETR-000.txt
Compressed Size: 838
Uncompressed Size: 1982
0
Filename: c:\PureBasic400\Program\PurePOP3_Debugfile\PurePOP3-TEST-DUMP.19
Compressed Size: 1602
Uncompressed Size: 3244
#PureZIP_RecursiveZeroDirs : also folder entries
Code: Select all
myFileinfo.PureZIP_FileInfo
PureZIP_AddFiles("c:\PureBasic400\Program\!!!.zip", "c:\PureBasic400\Program\PurePOP3_Debugfile\*.*" , #True, #PureZIP_RecursiveZeroDirs)
If PureZIP_Archive_Read("c:\PureBasic400\Program\!!!.zip")
ReturnValue.l = PureZIP_Archive_FindFirst() = #UNZ_OK
While ReturnValue = #UNZ_OK
Debug PureZIP_Archive_FileInfo(@myFileinfo)
Debug "Filename: " + myFileinfo\FileName
Debug "Compressed Size: " + Str(myFileinfo\CompressedSize)
Debug "Uncompressed Size: "+ Str(myFileinfo\unCompressedSize)
ReturnValue.l = PureZIP_Archive_FindNext()
Wend
PureZIP_Archive_Close()
EndIf
0
Filename: c:\PureBasic400\Program\PurePOP3_Debugfile\
Compressed Size: 2
Uncompressed Size: 0
0
Filename: c:\PureBasic400\Program\PurePOP3_Debugfile\In_00001.mai
Compressed Size: 810
Uncompressed Size: 1950
0
Filename: c:\PureBasic400\Program\PurePOP3_Debugfile\PurePOP3-DEBUG-COM.txt
Compressed Size: 979
Uncompressed Size: 2384
0
Filename: c:\PureBasic400\Program\PurePOP3_Debugfile\PurePOP3-DEBUG-RETR-000.txt
Compressed Size: 838
Uncompressed Size: 1982
0
Filename: c:\PureBasic400\Program\PurePOP3_Debugfile\PurePOP3-TEST-DUMP.19
Compressed Size: 1602
Uncompressed Size: 3244
Posted: Thu Dec 07, 2006 9:20 am
by gnozal
No feedback for the beta 1.70 so I assume it works well.
PureZIP 1.70
Changes :
- Added UNICODE support (ZLIB still works with ANSI strings).
Posted: Thu Dec 07, 2006 11:38 am
by Jacobus
Hi gnozal,
Have you an example to add and to remove one password at file zip with your library, please ? I can't do it
Posted: Thu Dec 07, 2006 11:46 am
by gnozal
Jacobus wrote:Hi gnozal,
Have you an example to add and to remove one password at file zip with your library, please ? I can't do it
You can create a ZIP file with a password or read a ZIP file with a password, but not "remove one password at file zip".
Just use PureZIP_SetArchivePassword() before the other functions.
Example : Create ZIP with password
Code: Select all
PureZIP_SetArchivePassword("MyPassword")
If PureZIP_Archive_Create("MyZIP.zip", #APPEND_STATUS_CREATE)
Debug PureZIP_Archive_Compress("MyFile.txt", #False)
PureZIP_Archive_Close()
EndIf
Example : Read ZIP with password
Code: Select all
PureZIP_SetArchivePassword("MyPassword")
If PureZIP_Archive_Read("MyZIP.zip")
ReturnValue.l = PureZIP_Archive_FindFirst() = #UNZ_OK
While ReturnValue = #UNZ_OK
Debug PureZIP_Archive_FileInfo(@myFileinfo.PureZIP_FileInfo)
Debug "Filename: " + myFileinfo\FileName
Debug "Compressed Size: " + Str(myFileinfo\CompressedSize)
Debug "Uncompressed Size: "+ Str(myFileinfo\unCompressedSize)
ReturnValue = PureZIP_Archive_FindNext()
Wend
PureZIP_Archive_Close()
EndIf
Posted: Sat Dec 09, 2006 11:51 pm
by AL90
Some question:
It is normal that "PureZIP_AddFiles()" returns false if a File with 0-Bytes is copied ?
I have add your lib successfully in my project but I have remove If/Endif
because my Tool will display (own) ErrorMessage if a file with 0-Bytes was copied.
BTW:
Some chances for add a Delete/Rename Funktion in further updates of your lib and a optional DestPath$ parameter for AddFile(s) ?
Thanks for your lib, its great.

Posted: Sun Dec 10, 2006 10:04 am
by Jacobus
Just use PureZIP_SetArchivePassword() before the other functions.
Ok, i didn't know where to put itself. Thanks.
Posted: Sun Dec 10, 2006 11:46 am
by mk-soft
Now Update to Version 1.70
That is right
a file entry to exist no longer the same folder entry
But I found the next problem. The germany files and foldern names with "äöü" are not right in a zip file.
FF

Posted: Mon Dec 11, 2006 9:27 am
by gnozal
mk-soft wrote:But I found the next problem. The germany files and foldern names with "äöü" are not right in a zip file.FF

It's a ZLIB problem.
Did you try the PureZIP_AsciiDosLatinUS_To_AsciiWinLatin1() function ?
From PureZIP.chm wrote:Translate a string from ASCII DOS Latin US to ASCII WIN Latin 1.
Usefull when compacting files with non english filenames (with french accents for example).
Original filename : "essai_é_à_ï_ù_è_ç.pb"
In ZIP archive : "essai_‚_…_‹_-_Š_‡.pb" (ZLIB don't use the correct page code)
Transformed with this function : "essai_é_à_ï_ù_è_ç.pb"
Posted: Mon Dec 11, 2006 9:33 am
by gnozal
AL90 wrote:Some question:
It is normal that "PureZIP_AddFiles()" returns false if a File with 0-Bytes is copied ?
Yes
AL90 wrote:I have add your lib successfully in my project but I have remove If/Endif because my Tool will display (own) ErrorMessage if a file with 0-Bytes was copied.
If you wish more control when using PureZIP, please use the PureZIP_Archive_* functions. Then you can decide what file to add or not, what error message display etc...
AL90 wrote:Some chances for add a Delete/Rename Funktion in further updates of your lib and a optional DestPath$ parameter for AddFile(s) ?
Probably not, because there is no ZLIB function for this. You have to unpack/repack the archive to do this.
Posted: Mon Dec 11, 2006 8:35 pm
by mk-soft
Is a probleme with WinLatin because the user deflate the archiv with another program. I write a spezial automatic backup program.
