English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 10 June 2020, 08:10   #1
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
XAD commands

Set up dopus to do all sort of nice things and I need some help with XAD commands. Usage of Xadunfile and xadundisk is pretty straight forward but I want xadunfile to create a directory (Same as the adf filename or to ask me for it) when unarchiving an adf file for example and not just dump everything into Ram let’s say. What would the command be for it? I tried XadUnfile {f} RAM: DIMG which is fine and extracts the adf or dms to ram. But what can I add in order to create the extraction in a dir (same as the adf or dms name) in ram? I know that xadunfile has extra commands like destdir and askmakedir for that reason but can’t figure out how to add them. Tried few ways but fails.

Last edited by npagonis73; 10 June 2020 at 08:27. Reason: Added some info
npagonis73 is offline  
Old 10 June 2020, 13:29   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Just an example and you have to make sure that no strange things will happen:
Code:
xadUnFile {fu} DEST RAM:{o} NOABS ASKMAKEDIR
daxb is offline  
Old 10 June 2020, 13:33   #3
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
Thanks Daxb, i will give it a go and report back.
npagonis73 is offline  
Old 10 June 2020, 14:09   #4
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
Unfortunately it fails and gives no result. I keep experimenting....
npagonis73 is offline  
Old 10 June 2020, 15:40   #5
jPV
Registered User
 
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 1,006
I once made this kind of AmigaDOS script for unarchiving adf files to a selected destination. It accepts adf filename as an argument and then it creates dirs with adf names to the destination where it unarchives them. Maybe there would be a simplier solution too, but if you want to test or play around:
Code:
.KEY FILE
If EXISTS "<FILE>"
    If EXISTS ENV:rnounadfd
        Set defdir $rnounadfd
    Else
        Set defdir "RAM:"
    EndIf
    C:RequestFile DRAWERSONLY TITLE "Select destination..." DRAWER="$defdir" > ENV:rnounadfd
    If NOT WARN
        CD $rnounadfd
        List "<FILE>" LFORMAT="%M" > ENV:rnounadff
        C:XADUnFile "<FILE>" "$rnounadff" DIMG
        Delete ENV:rnounadff >NIL:
    Else
        Delete ENV:rnounadfd >NIL:
    EndIf
    UnSet defdir
EndIf
BTW. I'm using this on MorphOS, so let me know if it fails on Amiga for some reason...
jPV is offline  
Old 10 June 2020, 16:56   #6
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
Quote:
Originally Posted by jPV View Post
I once made this kind of AmigaDOS script for unarchiving adf files to a selected destination. It accepts adf filename as an argument and then it creates dirs with adf names to the destination where it unarchives them. Maybe there would be a simplier solution too, but if you want to test or play around:
Code:
.KEY FILE
If EXISTS "<FILE>"
    If EXISTS ENV:rnounadfd
        Set defdir $rnounadfd
    Else
        Set defdir "RAM:"
    EndIf
    C:RequestFile DRAWERSONLY TITLE "Select destination..." DRAWER="$defdir" > ENV:rnounadfd
    If NOT WARN
        CD $rnounadfd
        List "<FILE>" LFORMAT="%M" > ENV:rnounadff
        C:XADUnFile "<FILE>" "$rnounadff" DIMG
        Delete ENV:rnounadff >NIL:
    Else
        Delete ENV:rnounadfd >NIL:
    EndIf
    UnSet defdir
EndIf
BTW. I'm using this on MorphOS, so let me know if it fails on Amiga for some reason...
Thanks a lot Jpv. I will experiment with this for sure.

In the meantime what i found is the following:

1) xadunfile {fu} DESTDIR "RAM:{o}/" DARC

The above extracts a dms file and creates a folder in ram which has the same name as the dms file. Changing the DARC command with DIMG, it extracts adf files.

2) If you don't want automatic folder creation and you want to create your own then swap the "RAM:{o}/" with "{Rd}/" and a requester will come up and you choose where you want it extracted.

Now back to Jpv script to experiment.

Last edited by npagonis73; 10 June 2020 at 16:57. Reason: Mistake
npagonis73 is offline  
Old 10 June 2020, 17:00   #7
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Quote:
Originally Posted by npagonis73 View Post
Unfortunately it fails and gives no result. I keep experimenting....
You need to activate option "Output to window" or remove ASKMAKEDIR. I've add some more options but that should do the trick. At least here it works.
daxb is offline  
Old 10 June 2020, 17:43   #8
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
Quote:
Originally Posted by daxb View Post
You need to activate option "Output to window" or remove ASKMAKEDIR. I've add some more options but that should do the trick. At least here it works.
Thanks again Daxb. I am looking into your solution as well. I am sure it will work.
npagonis73 is offline  
Old 10 June 2020, 22:26   #9
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
Quote:
Originally Posted by jPV View Post
I once made this kind of AmigaDOS script for unarchiving adf files to a selected destination. It accepts adf filename as an argument and then it creates dirs with adf names to the destination where it unarchives them. Maybe there would be a simplier solution too, but if you want to test or play around:
Code:
.KEY FILE
If EXISTS "<FILE>"
    If EXISTS ENV:rnounadfd
        Set defdir $rnounadfd
    Else
        Set defdir "RAM:"
    EndIf
    C:RequestFile DRAWERSONLY TITLE "Select destination..." DRAWER="$defdir" > ENV:rnounadfd
    If NOT WARN
        CD $rnounadfd
        List "<FILE>" LFORMAT="%M" > ENV:rnounadff
        C:XADUnFile "<FILE>" "$rnounadff" DIMG
        Delete ENV:rnounadff >NIL:
    Else
        Delete ENV:rnounadfd >NIL:
    EndIf
    UnSet defdir
EndIf
BTW. I'm using this on MorphOS, so let me know if it fails on Amiga for some reason...
JPV does that script works as it is in dopus if I choose amigados or do I need to do anything else?
npagonis73 is offline  
Old 10 June 2020, 22:37   #10
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
Quote:
Originally Posted by daxb View Post
You need to activate option "Output to window" or remove ASKMAKEDIR. I've add some more options but that should do the trick. At least here it works.
Hi there

After trying again I have the following:

1)ASKMAKEDIR doesn’t work for me. Really want to know how to make this option command to work
2)I do have output window as a flag
3)Without the command DARC OR DIMG at the end again it doesn’t work

If you see above How I made it work, the first half is as you say but the second part differs. I tried many versions of your commands which helped me reach a doable solution. I would really like to learn though how askmakedir works cause it seems easier!!
npagonis73 is offline  
Old 11 June 2020, 01:15   #11
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
I did some tests and the attached commands work well on Dopus4, see video:

https://drive.google.com/file/d/1_11...ew?usp=sharing


Unpack ADF to RAM:
xadUnFile {fu} DEST RAM:{o} DIMG
or
UnADF {f} DEST RAM:

Unpack DMS to RAM:
xadunfile {fu} DESTDIR "RAM:{o}/" DARC


Write ADF on DF0:
C:ADF2Disk {f}

Write DMS on DF0:
DmsDir.dopus {p} {o}

Last edited by AMIGASYSTEM; 11 June 2020 at 01:59.
AMIGASYSTEM is offline  
Old 11 June 2020, 07:39   #12
jPV
Registered User
 
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 1,006
Quote:
Originally Posted by npagonis73 View Post
JPV does that script works as it is in dopus if I choose amigados or do I need to do anything else?
It works in DOpus as either AmigaDOS or Script command.

Like this:
Code:
Function : AmigaDOS   Execute S:RNOUnADF.script {f}

   Flags : Output to window
           Run asynchronously
           Window close button
or this:
Code:
Function : Script     S:RNOUnADF.script {f}

   Flags : Output to window
           Run asynchronously
           Window close button
I've kept those "Output to window" and "Window close button" to see the output that everything went fine or if it asks for overwriting or so. And you should be able to leave the "Execute" away if you've added the S protection bit to the script, but it's safer to use it if you lose the bit at some point (backups or or).
jPV is offline  
Old 11 June 2020, 07:57   #13
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
AmigaSystem and JPV thanks a lot for your help and guidance. Appreciated!!! Have a good day
npagonis73 is offline  
Old 11 June 2020, 11:47   #14
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Quote:
Originally Posted by npagonis73 View Post
1)ASKMAKEDIR doesn’t work for me. Really want to know how to make this option command to work
2)I do have output window as a flag
3)Without the command DARC OR DIMG at the end again it doesn’t work

If you see above How I made it work, the first half is as you say but the second part differs. I tried many versions of your commands which helped me reach a doable solution. I would really like to learn though how askmakedir works cause it seems easier!!
Do you see a DOpus output window open when you use ASKMAKEDIR and/or "Output to window"? If not you should try to activate the option "Window close button" as jPV has already written. xadUnFile use (I guess) stdin/stdout. It is a command line tool and therefore assume the interface. If you don't have an output window open (and stay) it will write to nowhere and it breaks or wait infinity for input (ASKMAKEDIR).

I only tested with a single LHA archive. I do not have disk images. If the keywords DISKIMAGE or DISKARCHIVE are needed for ADF/DMS I do not know. You have to try. If you have a working Shell solution without the DOpus stuff you just need to adapt it. More or less only {fu} and {o} at the right places and the mentioned options checked. See also DOpus documentation.
daxb is offline  
Old 11 June 2020, 19:14   #15
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
XAD commands

Guys again thank you all for your help!! It all works great.

I have one last thing to ask about a strange behavior with xad under 3.9 compared to xad under 3.1.4.

Executing all above commands and scripts which use xad, under 3.9 (either in dopus or xvoodo2 which also use xad) and extracting any type of file lha, zip or adf and dms, you see the progress window extracting the files and then 1-2 files towards the end it stops (not freeze) and it takes 3-4 minutes to finish. Same procedure on the same A1200 with ACA but under 3.1.4 takes only 5 seconds.

This happens only if you use xad for extraction. Any other commands like lha or unzip or lzx or rar or extracting dms and adf with different commands, then it takes normal time!!!

Any ideas?
npagonis73 is offline  
Old 11 June 2020, 21:54   #16
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
I don't think it depends on OS 3.1.4, on WinUAE XAD even with OS 3.1.4 it behaves the same way, it may be that it stops for a check file!

Last edited by AMIGASYSTEM; 11 June 2020 at 22:45.
AMIGASYSTEM is offline  
Old 06 September 2020, 23:21   #17
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
Hello everyone. I am back to this post with another question.

The below is jPV's script for Dopus4 and xadunfile command using it to extract an ADF to any Dir on the amiga. It works like a dream on 3.1.4 and 3.9. Today i tried it on OS 3.1 (on the same A1200 and using the same version of Dopus 4.16) and it fails. Dopus freezes almost instantly while it brings up a window. I can only reset to have a usable amiga again. The script is s protected and using the same arguments.

".KEY FILE
If EXISTS "<FILE>"
If EXISTS ENV:rnounadfd
Set defdir $rnounadfd
Else
Set defdir "RAM:"
EndIf
C:RequestFile DRAWERSONLY TITLE "Select destination..." DRAWER="$defdir" > ENV:rnounadfd
If NOT WARN
CD $rnounadfd
List "<FILE>" LFORMAT="%M" > ENV:rnounadff
C:XADUnFile "<FILE>" "$rnounadff" DIMG
Delete ENV:rnounadff >NIL:
Else
Delete ENV:rnounadfd >NIL:
EndIf
UnSet defdir
EndIf"

Any ideas why?

Thanks
npagonis73 is offline  
Old 07 September 2020, 12:27   #18
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
DOpus4 freezes when started or the script freeze? For the first you might have an to old SetPatch version.
daxb is offline  
Old 07 September 2020, 13:41   #19
npagonis73
Registered User
 
npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 410
No dopus works fine with any commands and buttons I made but when I try to use the button assigned to that script then it freezes while trying to execute the script displaying the output window empty of course. I made this button using AmigaDos function and the command is “execute S:script name which is in S folder. The script is also S protected...
The same script with the same Dopus version on my two other systems 3.1.4 and 3.9 works fine. It doesn’t seem to be able to execute the script... either 3.1 needs me to do smg else or dopus is different under 3.1.

Any clues????
npagonis73 is offline  
Old 07 September 2020, 17:18   #20
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Write a simple script, e.g. "echo 'some text'" and integrate it the same way like you did with the non working script. If it works you can investigate the xad stuff script. If not there is something else going on.
daxb is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
External XAD LhA for 68k? hexaae support.Apps 14 22 January 2023 09:17
DOpus 4.17pre20 DMS XAD/XFD ClassicWB Octopus66 support.Other 3 05 May 2016 18:28
UnArchiving LHA Files Programmatically: Confused about XPK, XAD, XFD tygre Coders. C/C++ 18 17 June 2015 00:26
Fixed XAD for lha (OS3.9) ancalimon request.Apps 1 27 July 2014 17:39
RAR XAD - AmigaOS3 ? ancalimon request.Apps 6 19 January 2012 13:53

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:41.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10237 seconds with 13 queries