Programmatically test for a DVD drive

Joe Marcus Clarke marcus at FreeBSD.org
Fri Dec 19 12:09:22 PST 2003


On Fri, 2003-12-19 at 15:02, John-Mark Gurney wrote:
> Joe Marcus Clarke wrote this message on Tue, Dec 16, 2003 at 20:33 -0500:
> > I'm trying to figure out the best way to programmatically test to see if
> > a disc device is a DVD device.  That is, how can I tell the difference
> > between a CD-[ROM|R|RW] and a DVD-[ROM|R|RW]?  Is there a set method for
> > doing this, or should I just try to execute a DVD ioctl, and test to see
> > if it succeeds?  Thanks.
> 
> Take a look at cdrecord and see what that does...  But that might
> require you to use atapi-cam instead of the "normal" atapi-cd device.

Thanks for the pointer.  Using atapi-cam is not a problem since the
application I'm porting is basically a front-end to cdrecord which
requires atapi-cam.  However, I didn't know cdrecord detected the
difference on its own, or just did what it was told via command line
arguments.

Joe

> 
> You could also read the specs for atapi, and implement the ioctl for
> the atapi-cd drivers to do the query.
-- 
Joe Marcus Clarke
FreeBSD GNOME Team	::	marcus at FreeBSD.org
gnome at FreeBSD.org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20031219/87ef1323/attachment.bin


More information about the freebsd-hackers mailing list