English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   support.Other (http://eab.abime.net/forumdisplay.php?f=74)
-   -   XAD commands (http://eab.abime.net/showthread.php?t=102671)

npagonis73 10 June 2020 08:10

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.

daxb 10 June 2020 13:29

Just an example and you have to make sure that no strange things will happen:
Code:

xadUnFile {fu} DEST RAM:{o} NOABS ASKMAKEDIR

npagonis73 10 June 2020 13:33

Thanks Daxb, i will give it a go and report back.

npagonis73 10 June 2020 14:09

Unfortunately it fails and gives no result. I keep experimenting....

jPV 10 June 2020 15:40

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...

npagonis73 10 June 2020 16:56

Quote:

Originally Posted by jPV (Post 1406834)
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.

daxb 10 June 2020 17:00

Quote:

Originally Posted by npagonis73 (Post 1406810)
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. :)

npagonis73 10 June 2020 17:43

Quote:

Originally Posted by daxb (Post 1406864)
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 10 June 2020 22:26

Quote:

Originally Posted by jPV (Post 1406834)
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 10 June 2020 22:37

Quote:

Originally Posted by daxb (Post 1406864)
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!!

AMIGASYSTEM 11 June 2020 01:15

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}

jPV 11 June 2020 07:39

Quote:

Originally Posted by npagonis73 (Post 1406923)
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).

npagonis73 11 June 2020 07:57

AmigaSystem and JPV thanks a lot for your help and guidance. Appreciated!!! Have a good day

daxb 11 June 2020 11:47

Quote:

Originally Posted by npagonis73 (Post 1406928)
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.

npagonis73 11 June 2020 19:14

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?

AMIGASYSTEM 11 June 2020 21:54

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!

npagonis73 06 September 2020 23:21

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

daxb 07 September 2020 12:27

DOpus4 freezes when started or the script freeze? For the first you might have an to old SetPatch version.

npagonis73 07 September 2020 13:41

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????

daxb 07 September 2020 17:18

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.


All times are GMT +2. The time now is 23:34.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.

Page generated in 0.06846 seconds with 11 queries