LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Getting the free space in a blank cd or dvd? (https://www.linuxquestions.org/questions/linux-software-2/getting-the-free-space-in-a-blank-cd-or-dvd-479673/)

Tacroy 09-02-2006 02:16 AM

Getting the free space in a blank cd or dvd?
 
For various reasons, I'd like to know if there's some way to programmatically determine either whether a blank disc in the drive is a CD or DVD, or, preferably, to determine how much free space there is on the disc without mounting or formatting it. I'm pretty sure this is possible since growisofs will complain about there being only a certain number of blocks available even on unformatted DVDs, but looking at other people's source code gives me a headache.

I've looked through cdrom.h and it doesn't seem as if there's anything I could use in that although I did find out how to make the tray dance a merry little jig. Of course, it's more than likely I missed something.

J.W. 09-02-2006 11:52 AM

Not sure I understand your question - if you know that the disk is blank, then the capacity of a blank CD is 650Mg and the capacity of a blank DVD is 4.7G

Tacroy 09-02-2006 02:06 PM

Sorry about that, it was sort of late when I posted the message...

Basically, I want to be able to tell if the disc in the drive is a CD or a DVD, and I'm not sure how to do that from within a program. It would be nice if I could just get the total free space, since that's what I really care about, but I could hardcode values for CDs and DVDs if I have to.


All times are GMT -5. The time now is 07:13 AM.