Find out if an audio CD is inserted in the tray of the CD/DVD drive

scar scar at drigon.com
Tue Jan 5 00:42:45 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Raseel Bhagat @ 01/03/2010 10:03 PM:
> On Mon, Jan 4, 2010 at 10:00 AM, Detlef Lechner <Detlef.Lechner at gmx.net>wrote:
> 
>> Hello,
>>
>> what is the most elementary command line command to find out if an audio
>> CD is inserted in the tray of the CD/DVD drive?
>>
>>
> Are you looking specifically for "audio" CDs only or any CD in general.

i think he wants to know, via a command, whether or not there is an
audio CD in the drive.

best i could come up with is:

cdrdao disk-info

which will return, among other things, "Toc Type: CD-DA or CD-ROM" if
you have an audio CD in the drive.  however, in my experiment with a
data CD in the drive, cdrdao was not able to access the drive and
returned open errors for several seconds before dumping SCSI transport
information... not very graceful.
-----BEGIN PGP SIGNATURE-----

iEYEAREIAAYFAktCiwUACgkQXhfCJNu98qBbAwCg77HUpfceTiI0dQOTe0Y03sou
HYAAn3mlT2wd7mYX2yDQ6mix2heU21bu
=BBgu
-----END PGP SIGNATURE-----





More information about the ubuntu-users mailing list