Page 4 of 40

Posted: Mon Oct 10, 2005 2:26 pm
by IceSoft
What a pity!

Posted: Mon Oct 10, 2005 4:52 pm
by gnozal
Library update

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)

Posted: Mon Oct 10, 2005 7:37 pm
by IceSoft
@gnozal,

Thanks for your very fast support.
It works as specified now ;-)

Posted: Sun Dec 04, 2005 7:32 pm
by DoubleDutch
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.
Any easy way around this (apart from not using both at the same time!)... ?

Posted: Mon Dec 05, 2005 9:05 am
by gnozal
DoubleDutch wrote:
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.
Any easy way around this (apart from not using both at the same time!)... ?
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.

Maybe Fred knows how to fix this : viewtopic.php?t=18074 ?

Posted: Mon Dec 05, 2005 11:12 am
by DoubleDutch
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)...

Posted: Tue Dec 06, 2005 2:09 pm
by zikitrake
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

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

Posted: Tue Dec 06, 2005 4:43 pm
by gnozal
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
I agree the actual callback is very primitive : Progression = FileProcessed / TotalFilesToProcess * 100, and it only works for the following functions : PureZIP_ExtractFiles(), PureZIP_AddFiles().
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.

Posted: Thu Dec 15, 2005 6:10 am
by zikitrake
Please, any sample of

Code: Select all

PureZIP_Archive_FileInfo(*FileInfo.PureZIP_FileInfo)
and/or

Code: Select all

PureZIP_GetFileInfo(ArchiveFileName.s, FileNumberInArchive.l, *FileInfo.PureZIP_FileInfo) 
I'm tryng to get de Date of a file, but I don't know How can I do it :oops:
(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
but it returns incorrect date.

... and, again... thank you for this lib!

Posted: Thu Dec 15, 2005 9:17 am
by gnozal
zikitrake wrote:I'm tryng to get de Date of a file, but I don't know How can I do it :oops: ...
You have to use the tmu_date.tm.date structure
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
Note : I just discovered this tm_mon [0 - 11] thing now :oops: ...
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.

Posted: Thu Dec 15, 2005 9:48 am
by zikitrake
gnozal wrote:
zikitrake wrote:I'm tryng to get de Date of a file, but I don't know How can I do it :oops: ...
Note : I just discovered this tm_mon [0 - 11] thing now :oops: ...
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.
Really... very thank you... it works great :D, but

Code: Select all

Str(myFileinfo\tmu_date\tm_mon + 1) 
retrieves an incorrect month;

Code: Select all

Str(myFileinfo\tmu_date\tm_mon)
works fine

thank you again

Posted: Thu Dec 15, 2005 10:28 am
by gnozal
zikitrake wrote:
gnozal wrote:
zikitrake wrote:I'm tryng to get de Date of a file, but I don't know How can I do it :oops: ...
Note : I just discovered this tm_mon [0 - 11] thing now :oops: ...
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.
Really... very thank you... it works great :D, but

Code: Select all

Str(myFileinfo\tmu_date\tm_mon + 1) 
retrieves an incorrect month;

Code: Select all

Str(myFileinfo\tmu_date\tm_mon)
works fine

thank you again
I am confused :shock:
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 ?

Posted: Thu Dec 15, 2005 11:18 am
by zikitrake
gnozal wrote:I am confused :shock:
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 ?
Yes, I obtain the same results.

Posted: Thu Dec 15, 2005 11:25 am
by gnozal
zikitrake wrote: Yes, I obtain the same results.
Thanks !
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.

Posted: Thu Dec 15, 2005 11:41 am
by zikitrake
gnozal wrote:
zikitrake wrote: Yes, I obtain the same results.
Thanks !
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.
Thank you for your fast reply.