PureZIP library : ZIP / UNZIP files
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Library update
Changes
- fixed empty directory storing in archive (if StorePath enabled)
Changes
- fixed empty directory storing in archive (if StorePath enabled)
Code: Select all
; Dir structure :
;
; +Purebasic394
; |_+Program
; |_+Empty
; |_Empty
;
PureZIP_AddFiles("TEST.zip", "c:\PureBasic394\program\empty\*.*", #PureZIP_StorePathAbsolute, #True)
PureZIP_ExtractFiles("TEST.zip", "*.*", "c:\PureBasic394\Program\", #True)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Any easy way around this (apart from not using both at the same time!)... ?Note :
There is a known problem with PureZIP and the ImagePluginPNG purebasic library. If you use both in the same program, you will get a POLINK error "Symbol '_inflate_copyright' is multiply defined" because both use the ZLIB static library.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I tried to modify the name of the functions, like '_inflate_copyright' -> '_inflate-copyright' : it does compile without error, PureZIP functions work, but PNG functions crash. So I don't know how to fix this. Sorry.DoubleDutch wrote:Any easy way around this (apart from not using both at the same time!)... ?Note :
There is a known problem with PureZIP and the ImagePluginPNG purebasic library. If you use both in the same program, you will get a POLINK error "Symbol '_inflate_copyright' is multiply defined" because both use the ZLIB static library.
Maybe Fred knows how to fix this : viewtopic.php?t=18074 ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
From the link it looks like there is a problem. Hopefully Fred will look at this before v4 is released and there will be a fix (if possible)...
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Gnozal, first at all, thank you for this lib!
Are there any option to refresh better the CallBack for BIG files?; With small files it works great, but when I try to compress a 3Gb file, don't works appropriately
Are there any option to refresh better the CallBack for BIG files?; With small files it works great, but when I try to compress a 3Gb file, don't works appropriately
Code: Select all
Procedure CallbackForTest(file.s, PerCent.f)
Debug StrF(PerCent, 2) + "%"
EndProcedure
PureZIP_SetCallback(@CallbackForTest())
myzipfile1.s = "c:\images\image001.img" ;/3 Gb
If PureZIP_Archive_Create("c:\bck\image.zip", #APPEND_STATUS_CREATE)
PureZIP_Archive_Compress(myzipfile1.s, #False)
PureZIP_Archive_Close()
EndIf
PB 6.21 beta, PureVision User
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I agree the actual callback is very primitive : Progression = FileProcessed / TotalFilesToProcess * 100, and it only works for the following functions : PureZIP_ExtractFiles(), PureZIP_AddFiles().Are there any option to refresh better the CallBack for BIG files?; With small files it works great, but when I try to compress a 3Gb file, don't works appropriately
It is not implemented for the PureZIP_Archive_* functions you are using.
There is no compression progress callback at the moment like the PackerCallback() in Purebasic, because the ZLIB function zipWriteInFileInZip() don't support a callback, IIRC.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Please, any sample of and/or
I'm tryng to get de Date of a file, but I don't know How can I do it
(I'm using this code:
but it returns incorrect date.
... and, again... thank you for this lib!
Code: Select all
PureZIP_Archive_FileInfo(*FileInfo.PureZIP_FileInfo)
Code: Select all
PureZIP_GetFileInfo(ArchiveFileName.s, FileNumberInArchive.l, *FileInfo.PureZIP_FileInfo)

(I'm using this code:
Code: Select all
...
If PureZIP_GetFileInfo(ZIPACOMPARAR$, ReturnValue, @myFileinfo.PureZIP_FileInfo)
f$ = FormatDate("%yyyy%mm%dd", myFileinfo\dosdate)
Debug archivoActual + " -> DATE: " + f$
endif
... and, again... thank you for this lib!
PB 6.21 beta, PureVision User
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
You have to use the tmu_date.tm.date structurezikitrake wrote:I'm tryng to get de Date of a file, but I don't know How can I do it...
Please try the following code :
Code: Select all
MyZIP.s = "C:\PureBasic394\Program\test.zip"
; Get files information
For i = 0 To PureZIP_GetFileCount(MyZIP) - 1
Debug PureZIP_GetFileInfo(MyZIP,i , @myFileinfo.PureZIP_FileInfo)
Debug "Number " + Str(i)
Debug "Filename: " + myFileinfo\FileName
Debug "Compressed Size: " + Str(myFileinfo\CompressedSize)
Debug "Uncompressed Size: "+ Str(myFileinfo\unCompressedSize)
; FILE DATE --------------
; IMPORTANT : tmu_date\tm_mon = [0 - 11] : you have to add 1 to tm_mon to get the correct month
Debug "Last Modification Date : " + Str(myFileinfo\tmu_date\tm_mday) + "/" + Str(myFileinfo\tmu_date\tm_mon + 1) + "/" + Str(myFileinfo\tmu_date\tm_year) + " " + Str(myFileinfo\tmu_date\tm_hour) + ":" + Str(myFileinfo\tmu_date\tm_min) + ":" + Str(myFileinfo\tmu_date\tm_sec)
; ------------------------
Next

PureZIP does not handle the file date correctly when compressing / extracting (I forgot to add/substract 1 to tm_mon when compressing / extracting).
Expect a bug fix soon.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Really... very thank you... it works greatgnozal wrote:Note : I just discovered this tm_mon [0 - 11] thing nowzikitrake wrote:I'm tryng to get de Date of a file, but I don't know How can I do it...
...
PureZIP does not handle the file date correctly when compressing / extracting (I forgot to add/substract 1 to tm_mon when compressing / extracting).
Expect a bug fix soon.

Code: Select all
Str(myFileinfo\tmu_date\tm_mon + 1)
Code: Select all
Str(myFileinfo\tmu_date\tm_mon)
thank you again
PB 6.21 beta, PureVision User
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I am confusedzikitrake wrote:Really... very thank you... it works greatgnozal wrote:Note : I just discovered this tm_mon [0 - 11] thing nowzikitrake wrote:I'm tryng to get de Date of a file, but I don't know How can I do it...
...
PureZIP does not handle the file date correctly when compressing / extracting (I forgot to add/substract 1 to tm_mon when compressing / extracting).
Expect a bug fix soon., but
retrieves an incorrect month;Code: Select all
Str(myFileinfo\tmu_date\tm_mon + 1)
works fineCode: Select all
Str(myFileinfo\tmu_date\tm_mon)
thank you again

Using PB 3.94/NT4
A few tests :
1.
- I create a ZIP file (NOT with PureZIP)
- I list the files with PureZIP
- tm_mon is false (real month - 1) BUT :
- I list the files with 2 external ZIP tools : file date Ok
2.
- I create a ZIP file (WITH PureZIP)
- I list the files with PureZIP
- tm_mon is good BUT :
- I list the files with 2 external ZIP tools : file date is wrong : month is month + 1
Could you test this ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Yes, I obtain the same results.gnozal wrote:I am confused
Using PB 3.94/NT4
A few tests :
1.
- I create a ZIP file (NOT with PureZIP)
- I list the files with PureZIP
- tm_mon is false (real month - 1) BUT :
- I list the files with 2 external ZIP tools : file date Ok
2.
- I create a ZIP file (WITH PureZIP)
- I list the files with PureZIP
- tm_mon is good BUT :
- I list the files with 2 external ZIP tools : file date is wrong : month is month + 1
Could you test this ?
PB 6.21 beta, PureVision User
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Thanks !zikitrake wrote: Yes, I obtain the same results.
It's logical : PureZIP does not substract/add 1 to tm_mon when compressing / extracting, so PureZIP is coherent with itself but not compatible with the other archivers. It will be fixed.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Thank you for your fast reply.gnozal wrote:Thanks !zikitrake wrote: Yes, I obtain the same results.
It's logical : PureZIP does not substract/add 1 to tm_mon when compressing / extracting, so PureZIP is coherent with itself but not compatible with the other archivers. It will be fixed.
PB 6.21 beta, PureVision User