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

Benoit Minisini gambas at ...1...
Sat Jan 8 13:14:46 CET 2005


On Friday 07 January 2005 15:17, Dave sharples wrote:
> Hi all,
>
> 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.
>
> Not being a linux geek either I am completely stumped as to how to go
> about this.
>
> If someone could point me in the right direction as to which function I
> should use or any reading that would help I would be greatful.
>
> Cheers
> Dave
>
>

If you have a Linux 2.6 based system, you should have a special filesystem 
named 'sysfs' accessible under the "/sys" directory that describe your 
system. Under /sys/block, you will find all blocks devices installed on your 
system. I think it is possible to find the CD-ROMs by analyzing 
the /sys/block hierarchy.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list