Question about eject a cdrom.

Stef Bon stef at bononline.nl
Thu Nov 10 01:54:11 PST 2011


Hi,

I'm looking for a good way to program the open (with or without media) 
and close the tray
of a cdrom.

It looks like there is no single command to do that.

eject /dev/sr0

works when door is closed, simular to

udisks --eject /dev/sr0

(eventual media is not mounted)

but when door is open

the only thing that works is

eject -t /dev/sr0

Now with udisks it's easy to get the value the door is closed or not, 
well not entirely, when the door is closed, the property closed as 
available and set in:

udisks --show-info /dev/sr0

but when open, this property is not there. Now I can program this, by 
taking into account that when it's not set, the value closed is zero  ( 
which of course means it's open), but I think it should be set when 
calling udisks --show-info?

By the way, isn't there an option like:

udisks --property='name' device

which displays only the specific option.

Stef




More information about the devkit-devel mailing list