Program which accesses DVD drive

This is a discussion on Program which accesses DVD drive within the C Programming forums, part of the General Programming Boards category; Hello, I have to write a program for uni and part of it includes accessing the dvd drive to see ...

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    16

    Program which accesses DVD drive

    Hello,

    I have to write a program for uni and part of it includes accessing the dvd drive to see whether a disc is a dvd-rom, dvd-r, dvd+r.

    Could anyone give me some pointers to libraries which I should be looking into using?

    Thanks for any replies.

  2. #2
    Banned
    Join Date
    Jan 2009
    Posts
    30
    If you are on linux, why not simply see if /dev/dvd exists?
    Last edited by sphynxter; 01-29-2009 at 06:13 PM.

  3. #3
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,667
    Translation: for what operating system? If it's linux, you have your answer. Otherwise...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Registered User
    Join Date
    Dec 2008
    Posts
    16
    Windows but I don't mind doing it on linux if its easier.

    Cheers

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm not entirely sure that is "easy" to do in either. I expect that DVD burners (and there are some for Linux that you can probably get the source-code for) will know how to read that sort of information - but it's not something that for example Windows or Linux has a specific interface to read - instead it's a case of a specific IOCTL call to the driver that is likely to retrieve that sort of information.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    It's fairly easy on windows. You can use MCI specifically I found http://msdn.microsoft.com/en-us/libr...77(VS.85).aspx on MSDN.

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by zacs7 View Post
    It's fairly easy on windows. You can use MCI specifically I found http://msdn.microsoft.com/en-us/libr...77(VS.85).aspx on MSDN.
    Am I being stupid today, and can't find where that says if the disk is DVD, DVD-R or DVD+R, or is that not what the information gives? [The latter means that it doesn't solve the original question].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    Registered User
    Join Date
    Dec 2008
    Posts
    16
    winioctl.h seems to be what I'm after for windows although I can't find anything about it in any reference librarys or "the c programming languange" book by Brain Kernigham and Dennis Ritchie.

  9. #9
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    Quote Originally Posted by Dr.Zoidburg View Post
    winioctl.h seems to be what I'm after for windows although I can't find anything about it in any reference librarys or "the c programming languange" book by Brain Kernigham and Dennis Ritchie.
    I really think you'll need MMC6R02A.PDF from t10.org. The document is halfway down the page. This provides detailed information on the multi media command sets. Specifically, the READ DISC INFORMATION command. You'll also need the header files from the Windows DDK kit. You can download the whole DDK but you'll only need the header files since you should be doing this task from userland not the kernel.

    You definitely won't find this info in the K&R book.

  10. #10
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by BobS0327 View Post
    You definitely won't find this info in the K&R book.
    Bob gives good advice.

    I'd like to explain that the reason K&R doesn't contain any information about this is that K&R wrote a book on the language of C - the C language in itself doesn't know anything about DVD's - in fact it is perfectly possible to build a C compiler on or for a machine that doesn't have the capabilty of connecting a DVD-drive.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  11. #11
    Registered User
    Join Date
    May 2008
    Posts
    25
    Quote Originally Posted by BobS0327 View Post
    I really think you'll need MMC6R02A.PDF from t10.org. The document is halfway down the page. This provides detailed information on the multi media command sets. Specifically, the READ DISC INFORMATION command. You'll also need the header files from the Windows DDK kit. You can download the whole DDK but you'll only need the header files since you should be doing this task from userland not the kernel.

    You definitely won't find this info in the K&R book.
    That cleared it up quite well. I've been looking into this further and I think if figured out how the whole process works bar one thing. If I send MMC commands which are defined as SCSI interface, will it work using an optical drive which is SATA connected.

    I'm not sure as I read they are compatible however won't sata use different commands or something?

    Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Totally confused on assigment using linked lists
    By Uchihanokonoha in forum C++ Programming
    Replies: 8
    Last Post: 01-05-2008, 03:49 PM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 10:17 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21