[Gambas-user] CD-rom device & media detection

scatman scatman_ at ...17...
Fri Jan 7 17:28:02 CET 2005


Am Freitag, 7. Januar 2005 15:48 schrieb Rob:

Hello,

> On Friday 07 January 2005 09:17, Dave sharples wrote:
> > I'm reasonably new to gambas having come from VB6 and for my
> > first *real* app I need to somehow detect and list the CD
> > drives in a system and also detect if they have any media in
> > them.
>
> I've had to do this for a couple clients.  I'll try to post some
> code later today if I can dig it up.  But the simplest way is to
> try getting a directory of each cd's mount point and trapping
> the error.

Public SUB DeviceExist()

DIM sTemp AS String
DIM mnt AS File

 sTemp = Temp$ 
 
    SHELL "mount /here/your/DEVICE" 2>" & sTemp WAIT
    OPEN sTemp FOR READ AS #mnt

  KILL sTemp

   IF Lof(mnt) > 0 AND Lof(mnt) < 60 THEN
   Message.Error ("NO Medium")
 
END










More information about the User mailing list