You are not precise enough.
What operating system? What error? What is the statement of the error line? Does it extract a part of this archive?
I made a quick test in Windows with the last example script and it did work.
Extract archive with XAD plugin
Re: Extract archive with XAD plugin
Bizarre, i've put a ChangeDirectory() command just before xad.ExtractFile(1, k, file$) to extract archive to a different path.
All archives worked for the moment...
I've put change directory at the begining of your script and now it work for this new archive...
All archives worked for the moment...
I've put change directory at the begining of your script and now it work for this new archive...
Re: Extract archive with XAD plugin
Tou have to think slower
Do all tests, create full rest results in a sheet, compare results and all this info will lead you to the solution
Creating a small minimun working code. And experiment what going wrong will help you identify the problem.
In this case you have discover that using ChangeDirectory help.
Have you try to think whats going on ?
Have you create an output (debugprint) of active directory
Before changedirectory /after and etc ?
Do all tests, create full rest results in a sheet, compare results and all this info will lead you to the solution
Creating a small minimun working code. And experiment what going wrong will help you identify the problem.
In this case you have discover that using ChangeDirectory help.
Have you try to think whats going on ?
Have you create an output (debugprint) of active directory
Before changedirectory /after and etc ?
Christos
Re: Extract archive with XAD plugin
You should really try to understand what the script does to be able to make meaningful changes.papiosaur wrote: ↑Mon May 29, 2023 3:24 pm Bizarre, i've put a ChangeDirectory() command just before xad.ExtractFile(1, k, file$) to extract archive to a different path.
Look at this part:
Code: Select all
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
If the entry is a file, it extract this file.
Now, if you put a ChangeDirectory() before the xad.ExtractFile() then the script may have created directories in another path until the first file has to be extracted. Then it changes (with you inserted command) the directory and the following directories and files should extracted in this new location.
This cannot work and there is nothing bizzare.
Re: Extract archive with XAD plugin
Thanks plouf and Flinx for your explainations.
Sorry, i would like to do quickly... i must read more the documentations but without examples it's difficult for me, i didn't have do studies in programmation.
Sorry, i would like to do quickly... i must read more the documentations but without examples it's difficult for me, i didn't have do studies in programmation.
- Juan Carlos
- Posts: 889
- Joined: Mon Sep 06, 2010 1:02 pm
Re: Extract archive with XAD plugin
You don't worry do haven't programming studies, I hace It and for me also is difficult programming without examples, it is like to have a car and to know about mechannic but you don't know the driving signals, and how driving.
Re: Extract archive with XAD plugin
Hello,
i have an XAD error message when i want to update a software already launched.
Seems executable file is write protected and i have this error message.
Is it possible to force extraction and relaunch the software please?
i have an XAD error message when i want to update a software already launched.
Seems executable file is write protected and i have this error message.
Is it possible to force extraction and relaunch the software please?
Re: Extract archive with XAD plugin
Nope a file locked by OS ..
The correct waY is to ask user to close it and retryyou can also kill it by command line "taskkill /IM "process name" /F"
But realy you should ask user
The correct waY is to ask user to close it and retryyou can also kill it by command line "taskkill /IM "process name" /F"
But realy you should ask user
Christos
Re: Extract archive with XAD plugin
Yeah, you can catch the error in your script and then open a requester to tell the user to close the application. Make your program to try again after that.
Re: Extract archive with XAD plugin
Thanks a lot for your reply!
The problem here: the application to kill is the application who realize the extraction, is it always possible?
Sorry if forgot to say it.
The problem here: the application to kill is the application who realize the extraction, is it always possible?
Sorry if forgot to say it.