03 October 2018, 22:44 | #1 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
How to check if a volume/drive exists?
Is there a command to check if a drive/volume exists before using the CD command to change to it and run a script? This is because my User-Startup uses this command at the moment to change to DH4:, but not all my configurations have a DH4: and this command is being called from a WB HDF.
I thought "IF EXISTS DH4:" would work fine, but apparently not. EDIT: Reply if you like, but I think I've found a workaround if there's no solution to this issue. However, if there is a solution, then I'll happily accept it. Last edited by Foebane; 03 October 2018 at 23:27. |
04 October 2018, 01:04 | #2 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
Isn't there an "assign dh4: exists"?
|
04 October 2018, 01:50 | #3 |
Registered User
Join Date: Oct 2012
Location: South Shields
Posts: 812
|
Assign >NIL: exists dh4:
if not warn do something else dont bother endif |
04 October 2018, 05:57 | #4 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
|
04 October 2018, 06:23 | #5 |
Registered User
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,767
|
|
04 October 2018, 07:53 | #6 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
My solution was to simply add DH4: to the configuration and point to an empty "@" file, so there wouldn't be any more "Drive DH4: is empty" messages and yet it wouldn't run anything else.
Now the User-Startup lines involved are simply: CD DH4: EXECUTE @ When I tried the script suggested by Acid, the DH4: wasn't executed either way, and to be honest, I'm still rusty on some AmigaDOS commands. At least I know what the two above lines do. |
04 October 2018, 08:27 | #7 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Acid's solution works fine so you most probably did it wrong. Easy check: Code:
assign >NIL: DH4: exists if not warn echo "DH4: found" else echo "DH4: not available" endif |
|
04 October 2018, 11:24 | #8 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,856
|
If you are using ARP, you can use the following :
Code:
IF EXISTS DH4: <put your code here> ELSE <put your code here> ENDIF Nice one ! Last edited by malko; 04 October 2018 at 11:32. |
04 October 2018, 11:51 | #9 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Cool, it worked this time! Don't know what I did wrong before.
Thanks, StingRay, Acid and Malko! I guess I gave up too easily. |
16 February 2023, 17:26 | #10 |
Registered User
Join Date: Mar 2009
Location: texas,usa
Posts: 235
|
check for cd
I know this is a old thread,but there is something on Aminet that may apply:
aminet.net/disk/misc/chkcd10.lha |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Same name for HDToolbox Drive Type, Partition and Volume NOT a problem? | Foebane | support.Apps | 24 | 14 March 2018 21:21 |
Check if PROGDIR: exists? | AGS | Coders. System | 13 | 13 April 2015 01:33 |
CD audio volume change is not applied if Paula volume is changed, too | thomas | support.WinUAE | 1 | 21 March 2014 16:50 |
Interest Check: A1010, Golden Hawk MIDI 500 and C64 floppy drive | ApolloBoy2 | MarketPlace | 1 | 01 December 2011 23:01 |
Please insert volume System: in any drive.... | asm1 | project.ClassicWB | 7 | 19 January 2010 18:35 |
|
|