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: 102
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: 2,600
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: 102
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: 102
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: 771
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: 102
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: 2,600
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: 102
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: 102
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: 102
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)
Posts: 5,945
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: 771
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: 102
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: 2,600
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: 102
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)
Posts: 5,945
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  
 


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 10 09 March 2020 14:54
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 14:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.08926 seconds with 15 queries