PDA

View Full Version : How to know the CD-ROM drive is cd or dvd drive?




ChrisWu
Jul 31, 2009, 12:55 AM
:)
Hi guys,
I noticed that
1.The command line "system_profiler" can retrieve the information of devices, including CD-ROM Drive. Read the infomation, I see it CAN NOT determine whether it is a CD or DVD drive.

2.Some one said the low level C based Unix library "ioctl" can not sovle the problem. So far, I've used the example code on my hard disk which location is: /Developer/Examples/DiscRecording/C/drioctl.

In this example, it use DRCopyDeviceArray(void) to get the all writable devices connected to the system.

As you know, my CD-ROM drive is not a burner, so when calling this function, I got CFArrayRef data which was nil, and in the gdb showing a line :"Sorry, no CD/DVD drives were found". I am sure there is a CD-ROM drive.

Above two methods can not detect the cd drive or dvd drive.

If you have any idea, please tell me.

Best regards,
Chris
:)



seb-opp
Jul 31, 2009, 07:43 AM
What machine have you got?
All macs with combo drives can read DVDs and read and write CDs
All macs with super drives can read and write both DVDs and CDs

If you go to the disc burning tab in system profiler it will list the types of CDs and DVDs your drive can write

kainjow
Jul 31, 2009, 10:41 AM
You're going to probably have to dive into IOKit to determine this info.