[comp.sys.amiga] How to tell if Volume is Mounted?

hsgj@batcomputer.UUCP (03/25/87)

[]
   Does anyone know how to tell if a Volume is mounted or not?
I use my own varient of Phillip Lindsay's GetDisk, which scans
through the DeviceLists (headed by DevInfo) and reports all the
Volume names.  But I can't figure out where in the DeviceList
structure the flag for mounted or not-mounted is maintained.  It
must be there somewhere because the CLI's INFO command can tell.
   So if I give you either a volume name, or a pointer to a
DeviceList (eg from the Volume field in a lock), how could I
determine whether the volume was mounted?  Thanks very much
for any information.
   [In case this is unclear, put wbench (with C:) in df0:, cd to
a floppy in df1:, then eject df1: and type INFO.  You'll see that
the disk name for the disk formerly in df1: is printed, but it does
not say "Mounted" next to it].

ps: On another topic, Thanks very much for all the responses to my
'clever' note on how to decrease Lattice code size.  Gosh, I never
knew that changing LIBRARY lc.lib,amiga.lib to LIBRARY amiga.lib,lc.lib
could make so much of a difference!  What a fool I was!  Well, as those
with mud on our faces always say, if you don't ask, you'll never learn...

-- Dan Green
-- 
ARPA:  hsgj%vax2.ccs.cornell.edu@cu-arpa.cs.cornell.edu
UUCP:  ihnp4!cornell!batcomputer!hsgj   BITNET:  hsgj@cornella

cmcmanis@sun.UUCP (03/25/87)

In article <489@batcomputer.tn.cornell.edu>, Dan Green writes:
< [] <---- Not needed
<    Does anyone know how to tell if a Volume is mounted or not?
< I use my own varient of Phillip Lindsay's GetDisk, which scans
< through the DeviceLists (headed by DevInfo) and reports all the
< Volume names.  But I can't figure out where in the DeviceList
< structure the flag for mounted or not-mounted is maintained.  It
< must be there somewhere because the CLI's INFO command can tell.
<    So if I give you either a volume name, or a pointer to a
< DeviceList (eg from the Volume field in a lock), how could I
< determine whether the volume was mounted?  Thanks very much
< for any information.
< -- Dan Green

The simple answer is look in the code for the C version of Assign that
I wrote on Fish disk fifty something. The real answer is the file
handler field. It contains the address of the file handler task that 
is handling this volume. It will be NULL when the Volume is not mounted.
This is also a quick way to check if accessing this volume will cause
an 'Insert Disk' requester to appear.


-- 
--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.