[ale] Detetcting a DVD in the drive?

Jim Kinney jim.kinney at gmail.com
Tue Aug 25 08:16:25 EDT 2009


I find it perversely amusing that the software that controls the
hardware is called hal.

What were they thinking??? "I'm sorry, Dave. I can't open the drive
door now. It might jeopardize the mission and I can't allow that."

If some smart-alec kernel hacker adds hal error voice out like H.A.L.
I'm going to have to give up on computers....

On Mon, Aug 24, 2009 at 11:10 PM, Brian Pitts<brian at polibyte.com> wrote:
> On 08/24/2009 06:28 PM, Robert L. Harris wrote:
>>
>>    I am trying to write a script for a friend to automatically dump an
>> ISO to a
>> DVD, but I am looking for a way to detect a DVD in the drive.  Anyone have
>> a way to do this?   "mt -f /dev/cdrom status" fails, unsurprisingly....
>>
>> Robert
>>
>
> Something like the following, assuming there's only one optical drive in
> the system.
>
> brian at triangle:~$ DRIVE=$(hal-find-by-capability --capability
> "storage.cdrom")
> brian at triangle:~$ echo $DRIVE
> /org/freedesktop/Hal/devices/storage_model_DVD__RW_TS_L632D
> brian at triangle:~$ MEDIA=$(hal-get-property --udi $DRIVE --key
> storage.removable.media_available)
> brian at triangle:~$ echo $MEDIA
> true
> brian at triangle:~$ eject
> brian at triangle:~$ MEDIA=$(hal-get-property --udi $DRIVE --key
> storage.removable.media_available)
> brian at triangle:~$ echo $MEDIA
> false
>
> I thought that
>
> hal-find-by-property  --key "storage.removable.media_available" --string
> "true"
>
> would work, but apparently hal-find-by-property only works when the key
> values are strings, and this key value is boolean? That's the best
> explanation I could come up with.
>
> --
> All the best,
> Brian Pitts
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
>



-- 
-- 
James P. Kinney III
Actively in pursuit of Life, Liberty and Happiness



More information about the Ale mailing list