English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 09 May 2021, 04:10   #1
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Checking volume exists/mounted without popping requester?

Is there a way to check that a volume is mounted (specifically, checking if someone's inserted a disk into df1: ) without popping the intuition requester?


(I'm aware of the hack given in the manual - Poke.l Peek.l(Peek.l(4)+276)+184,-1 - to disable the requester entirely, but I'd prefer to avoid doing that if at all possible since the game might be played in a Workbench environment)
earok is offline  
Old 10 May 2021, 14:34   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
You could periodically scan the list of volumes, either using OS dos.library calls, or using the ElmoreDOSLib. It contains GetAssigns and Assign$ keywords, that can work something like this:

Code:
GetAssigns 2 ; 2 represents volumes
done = False
Repeat
  x$ = Assign$
  If x$ = "" Then done = 1
  If LCase$(x$) = "testvolume:" Then done = 2
Until done

If done = 2
  NPrint "TestVolume: is mounted"
End If
Daedalus is offline  
Old 11 May 2021, 00:39   #3
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Quote:
Originally Posted by Daedalus View Post
You could periodically scan the list of volumes, either using OS dos.library calls, or using the ElmoreDOSLib. It contains GetAssigns and Assign$ keywords, that can work something like this:

Code:
GetAssigns 2 ; 2 represents volumes
done = False
Repeat
  x$ = Assign$
  If x$ = "" Then done = 1
  If LCase$(x$) = "testvolume:" Then done = 2
Until done

If done = 2
  NPrint "TestVolume: is mounted"
End If
Thanks, that seems to do what I want
earok 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
How to check if a volume/drive exists? Foebane support.Apps 9 16 February 2023 17:26
integrating cd volume in master volume honx request.UAE Wishlist 2 14 June 2020 22:43
CD audio volume change is not applied if Paula volume is changed, too thomas support.WinUAE 1 21 March 2014 16:50
Shell: test if a volume is mounted z00mba support.Apps 2 17 June 2006 12:28
A4000 popping sound jrom support.Hardware 7 10 May 2004 10:32

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

Top

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