Posted: Mon Oct 10, 2005 2:26 pm
What a pity!
http://www.purebasic.com
https://www.purebasic.fr/english/
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)
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.
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.
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
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
Code: Select all
PureZIP_Archive_FileInfo(*FileInfo.PureZIP_FileInfo)
Code: Select all
PureZIP_GetFileInfo(ArchiveFileName.s, FileNumberInArchive.l, *FileInfo.PureZIP_FileInfo)
Code: Select all
...
If PureZIP_GetFileInfo(ZIPACOMPARAR$, ReturnValue, @myFileinfo.PureZIP_FileInfo)
f$ = FormatDate("%yyyy%mm%dd", myFileinfo\dosdate)
Debug archivoActual + " -> DATE: " + f$
endif
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...
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
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)
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
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 ?
Thanks !zikitrake wrote: Yes, I obtain the same results.
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.