Posted: Fri Sep 28, 2007 6:07 pm
Only classic ZIP archive.Micko wrote:Gnozal can purezip support an other archive format ? like ace, tar... or just zip archive
http://www.purebasic.com
https://www.purebasic.fr/english/
Only classic ZIP archive.Micko wrote:Gnozal can purezip support an other archive format ? like ace, tar... or just zip archive
Currently, you can't.Inf0Byt3 wrote:I seem to have a problem stopping the compression. I use PureZIP_AddFiles and in the Compression callback even I return #True it won't stop. I read in the manual that the returned value is only for PureZIP_Archive_Compress() and PureZIP_Archive_Extract(). How can I stop it from a PureZIP_AddFiles command?
Code: Select all
Global All_Percent.f
...
...
...
Procedure.l PureZIP_CallbackC(File.s, PerCent.f)
All_Percent + PerCent
SetGadgetState(ProgressBar, All_Percent)
Event=WindowEvent()
If Event=#PB_Event_Gadget
If EventGadget()=31
DisableGadget(31,1)
SetWindowTitle(1,"Process Breaked ... Please Wait!")
ArcBreak=#True
EndIf
EndIf
ProcedureReturn ArcBreak
EndProcedure
I assume you use PureZIP_AddFiles() ?AL90 wrote:I try to create a complete CallBackC for all Files in one process.
....
No. I use PureZIP_Archive_Compressgnozal wrote:I assume you use PureZIP_AddFiles() ?
Yes, that is it what I want to use (TotalBytes of all Files for view in a single ProgressBar Gadget)The compression callback is only for the (de)compression process.
Yes I known. But here is my problem. The value 100.0 will returnPerCent.f is set to zero before each compression and to 100 when the compression is completed.
How I say above, my think is a CallBackC to calculateUse the progression callback to display the 'file progression', or use your own file counter.
It's a precision problem I think.AL90 wrote:But here is my problem. The value 100.0 will return more than 1 x, after the Compression from a single file. Sometimes displays the Debugger up to 10 x 100.0 (%) in the CallbackC Procedure.
I understand that, but you can still use your own counter : each time you compress a file, increment your counter, so your progression will be PerCent.f * MyOwnCounter.lAL90 wrote:How I say above, my think is a CallBackC to calculateUse the progression callback to display the 'file progression', or use your own file counter.
All Bytes of Files added in one variable for use in a Status-Panel with only one ProgressBar Gadget.
Ok I will see what for a solution I can use. Thanks for the suggestion.gnozal wrote:I understand that, but you can still use your own counter : each time you compress a file, increment your counter, so your progression will be PerCent.f * MyOwnCounter.l
StorePath values :
#TRUE : the complete filename (including path) is stored ;
#FALSE : only filename is stored.
Like this ?Inf0Byt3 wrote:Gnozal, how can I create the archive with PureZip_Archive commands and have the paths in the archive relative? I can't use PureZIP_AddFiles() because I want to be able to stop it and PureZIP_Archive_Compress() can only store full path or none. Is there a way to do this?
Code: Select all
; Store relative to base directory
BaseDirectory.s = "c:\Purebasic400"
SetCurrentDirectory(BaseDirectory)
If PureZIP_Archive_Create("c:\Test.zip", #APPEND_STATUS_CREATE)
FileToAdd.s = "c:\Purebasic400\Compilers\APIFunctionListing.txt"
RelativeFilePath.s = RemoveString(FileToAdd, BaseDirectory, 1)
PureZIP_Archive_Compress(RelativeFilePath, #True)
PureZIP_Archive_Close()
EndIf
What is wrong with my example, it's the same as #PureZIP_StorePathRelative ?Inf0Byt3 wrote:Nope, that's not quite what i needed. I need to simulate PureZIP_AddFiles as I said earlyer but i cannot do that if the files are stored either with full path or none.
I cannot 'just' add a #PureZIP_StorePathRelative flag : PureZIP_Archive_Compress() does not know the base directory, only the path of the file you want to compress, so how should the function store a path relative to base directory ?Inf0Byt3 wrote:Could you please add a #PureZIP_Path_Relative to the PureZIP_Archive_Compress command?