Page 2 of 5

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 2:55 pm
by papiosaur
ok find i have added "Changedirectory" before open archive and it work ;-)

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 3:13 pm
by Flinx
I had tried to add the Volume to the PathPart. Something like "RAM:"..PathPart(...

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 3:37 pm
by papiosaur
Bizarre, i get error during extraction and all files are not extracted...

Seems XAD not extract empty drawers... and i have the same problem with CopyFiles().

Andreas : could you add this features for next version please for XAD and CopyFiles() ?

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 3:40 pm
by Flinx
That is a problem with my script. It needs to check the type with xad.GetFileAttributes() before extracting or creating a directory.

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 3:55 pm
by Flinx
Please try this:

Code: Select all

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
		MakeDirectory(file$)
	Else
		xad.ExtractFile(1, k, file$)
	EndIf
Next
xad.CloseArchive(1)

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 6:42 pm
by papiosaur
Thanks for this new example, i've tried and i have this error message:

Error creating directory OpenBor/paks
in function MakeDirectory(file$)

Note: this drawer is an empty directory (to save pak file)

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 8:16 pm
by papiosaur
i try activate my progress bar but don't work.

It work with DownloadFile() but don't with Extractfile()...

i try to use progress option but don't work.

If you have an idea, i take ;-)

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 8:22 pm
by Flinx
Can you make a little archive so that I can reproduce the error?

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 9:02 pm
by papiosaur
Yes, of course, this is the link of the archive:

https://www.morphos-storage.net/dl.php?id=1532994

Re: Extract archive with XAD plugin

Posted: Wed May 17, 2023 10:36 pm
by papiosaur
Maybe CopyFile() command is better because i just want to extract all files of an archive to a destination...

xad.extractfile seems very complicated i found no ?

If you have an example of progressbar with CopyFile() command with an archive, i'm interested.

Thanks !