Extract archive with XAD plugin
Re: Extract archive with XAD plugin
I'll look at it tomorrow.
Re: Extract archive with XAD plugin
Thanks Flinx !
Re: Extract archive with XAD plugin
Now I have tried with Linux, Windows and OS3 (in WinUAE). The example script works with your lha archive and I get even the empty directory OpenBOR/Paks.
What happens if you try only the following line (in the same directory where you tried the example script)?
What happens if you try only the following line (in the same directory where you tried the example script)?
Code: Select all
MakeDirectory("OpenBOR/Paks")
Re: Extract archive with XAD plugin
Because I have an idea what could be causing the error I made the script a bit more informative.
Code: Select all
@REQUIRE "xad"
filename$="test.lha"
If Not Exists(filename$) Then DebugPrint(filename$,"not found")
xad.OpenArchive(1, filename$)
XAD_ARCHIVE = xad.GetObjectType()
numentries = GetAttribute(XAD_ARCHIVE, 1, #XADATTRNUMENTRIES)
For Local k = 0 To numentries - 1
Local file$=xad.GetFileAtIndex(1, k)
Local path$=PathPart(file$)
DebugPrint(file$)
If Not Exists(path$) And Not EmptyStr(path$)
MakeDirectory(path$)
EndIf
If xad.GetFileAttributes(1, k).Type = #DOSTYPE_DIRECTORY
If Exists(file$)
If Not IsDirectory(file$) Then Error("Cannot make the directory "..file$.." because a file with this name already exists.")
EndIf
MakeDirectory(file$)
Else
xad.ExtractFile(1, k, file$)
EndIf
Next
xad.CloseArchive(1)
Re: Extract archive with XAD plugin
Thanks a lot Flinx !!!!
It work perfectly on archives i have tested and works fine with OpenBOR archive too.
I have added progress bar support with max = numentries and level = k+1.
It work perfectly on archives i have tested and works fine with OpenBOR archive too.
I have added progress bar support with max = numentries and level = k+1.
Re: Extract archive with XAD plugin
Hello,
is there a limitation of number of files in an archive ?
I have an archive with 2226 files (Vim for MorphOS on Aminet) and the progress bar doesn't work... (work for all others for the moment).
Thanks for your return.
Andreas maybe ?
is there a limitation of number of files in an archive ?
I have an archive with 2226 files (Vim for MorphOS on Aminet) and the progress bar doesn't work... (work for all others for the moment).
Thanks for your return.
Andreas maybe ?
Re: Extract archive with XAD plugin
I don't think that there is a limit at this small values. But such things you can test by yourself. I made a quick script to generate 50000 little text files (this can be done in a simple loop using StringToFile() ), made an archive from it, and my example script extracted this like expected.
Use DebugPrint() to look at the values in your program. If your code is based on the example then first check numentries.
Does the script extract all 2226 files? If yes, then the problem must be in your calculation of the value for your progressbar.
Can you show how you did this?
Use DebugPrint() to look at the values in your program. If your code is based on the example then first check numentries.
Does the script extract all 2226 files? If yes, then the problem must be in your calculation of the value for your progressbar.
Can you show how you did this?
Re: Extract archive with XAD plugin
Yes, the 2226 files are extracted.
Values for progress bar are:
max = numentries
level = k+1
Values for progress bar are:
max = numentries
level = k+1
Re: Extract archive with XAD plugin
ok sorry, it works...
i have a bad condition before... i'm a real newbie
Sorry one more time...
i have a bad condition before... i'm a real newbie
Sorry one more time...
Re: Extract archive with XAD plugin
Bizarre, i have an error during extracting this archive with XAD:
https://www.morphos-storage.net/?id=1900112
I don't understand why...
https://www.morphos-storage.net/?id=1900112
I don't understand why...