How to know the CD-ROM drive is cd or dvd drive?

Discussion in 'Mac Programming' started by ChrisWu, Jul 30, 2009.

  1. macrumors newbie

    Joined:
    Jul 30, 2009
    #1
    :)
    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
    :)
     
  2. macrumors 6502

    Joined:
    Nov 16, 2008
    Location:
    London/Norwich
    #2
    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
     
  3. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
    You're going to probably have to dive into IOKit to determine this info.
     

Share This Page