Only classic ZIP archive.Micko wrote:Gnozal can purezip support an other archive format ? like ace, tar... or just zip archive
PureZIP library : ZIP / UNZIP files
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
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?
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
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?
If you want full control, use the PureZIP_Archive_*() functions.
The other functions are just to make the programmer's life easier.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hello Gnozal,
I try to create a complete CallBackC for all Files in one process. Example:
I have set the ProgressBar's maximum attribute (#PB_ProgressBar_Maximum) to 100 * NumFiles.l
For Example:
ProgressBarGadget(30, 22, 23, 376, 26, 0, 100 * NumFiles)
But it doesn't work. I have set a Debug PerCent.f in the Procedure and see now that when a File is done,
the CallBack is called anymore when the PerCent.f value is already on 100.0 %. (Sometimes called up to 10 x or more)
It is possible to fix it ? I use PureZIP 1.92.
I try to create a complete CallBackC for all Files in one process. Example:
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
For Example:
ProgressBarGadget(30, 22, 23, 376, 26, 0, 100 * NumFiles)
But it doesn't work. I have set a Debug PerCent.f in the Procedure and see now that when a File is done,
the CallBack is called anymore when the PerCent.f value is already on 100.0 %. (Sometimes called up to 10 x or more)
It is possible to fix it ? I use PureZIP 1.92.
Hi! Please check your progressbar gadget code. Usually the gadget editor makes the minimum 0 and the maximum 10, not 100 as you expect. It took some time to understand here too.
[Edit]
Sorry i misread your post. Please ignore.
[Edit]
Sorry i misread your post. Please ignore.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I assume you use PureZIP_AddFiles() ?AL90 wrote:I try to create a complete CallBackC for all Files in one process.
....
The compression callback is only for the (de)compression process. PerCent.f is set to zero before each compression and to 100 when the compression is completed.
Use the progression callback to display the 'file progression', or use your own file counter.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
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.
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.
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.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
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.
The last compression progression values may be 99.9997, 99.9998, 99.9999 ... all rounded to 100.0.
And PureZIP sends an extra '100.0' value when the compression is finished.
This should not be not a problem for displaying a progression bar.
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.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
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?

StorePath values :
#TRUE : the complete filename (including path) is stored ;
#FALSE : only filename is stored.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
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
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
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. Could you please add a #PureZIP_Path_Relative to the PureZIP_Archive_Compress command?
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
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.
In test.zip, the file is stored as 'Compilers/APIFunctionListing.txt', wich is the path relative to 'c:\Purebasic400\' for 'c:\Purebasic400\Compilers\APIFunctionListing.txt'.
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?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).