16 August 2021, 10:11 | #1 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
WHDLoad transfer script from archive to DH0 doesn't work
I am trying to write a script that will examine the contents of a WHDLoad archive (with any name, hence the first line) and to see if the folder of the game exists in a folder on DH0. If it doesn't, then I want it to copy those files to that folder. The second part of the script will then run the game from DH0 instead of the archive, which is read-only.
The problem is, I am rusty on such things and thought I could approach it this way: Code:
s:spat cd #?.dir assign >nil: dh0:games/b/blackviper if warn copy all to dh0:games/b/blackviper endif cd dh0:games/b/blackviper wbrun blackviper EDIT: I forgot to put "exists" at the end of the assign, but when I added it, it still didn't work. |
16 August 2021, 10:36 | #2 |
Registered User
Join Date: May 2018
Location: Germany, Baden-Wuerttemberg
Posts: 387
|
assign >NIL: blackviper: dh0:games/b/blackviper
You forgot to tell assign what drive name you wanted your path to be assigned to. Also, while testing something like this, it may prove beneficial to leave out the >NIL: first. Redirecting to NIL: effectively "swallows" all error messages. Last edited by torsti76; 16 August 2021 at 10:42. |
16 August 2021, 10:48 | #3 |
Registered User
Join Date: May 2018
Location: Germany, Baden-Wuerttemberg
Posts: 387
|
To check if a folder exists, rather than doing an assign, I'd try:
failat 21 (don't know the error level really, you'd have to look it up} dir >NIL: dh0:/path/to/game if warn ... failat (whatever it was before) |
16 August 2021, 12:32 | #4 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
If you want to check for exists of file/directory then use IF EXISTS. See https://wiki.amigaos.net/wiki/AmigaO...d_Reference#IF
|
16 August 2021, 18:43 | #5 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Thanks for the advice, torsti76 and daxb, especially the "IF EXISTS" command.
I changed my script to this: Code:
s:spat cd #?.dir if not exists dh0:games/b/blackviper copy all to dh0:games/b endif cd dh0:games/b/blackviper wbrun blackviper |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Eat the whistle WHDLoad versione doesn't work on Amiga 600 with Furia Accelerator... | Aminta | support.Games | 14 | 04 March 2020 23:17 |
formatting DH0:NDOS, doesn't work | Fender72 | support.WinUAE | 8 | 07 July 2016 15:34 |
transfer/convert DH0/1 from NTFS to Hardfile | tjukken | support.WinUAE | 1 | 10 June 2016 16:24 |
McDonald Land WHDLoad doesn't work on my setup | Amiga1992 | support.Games | 7 | 17 January 2014 19:42 |
How does one work out the 16-bit key for an RNC archive? | MethodGit | Coders. General | 20 | 28 December 2011 00:23 |
|
|