How to gather info about currently inserted cd/dvd? (Solved)

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

How to gather info about currently inserted cd/dvd? (Solved)

#1 Post by akash_rawal »

Does anyone know how to write a program to detect the following about currently inserted media in a given optical drive?
  • Type of media i.e. CDROM/CD-RW/DVD-ROM etc.
  • Type of data stored in media i.e. audio, video, data, blank etc
  • Label
Either in bash or C, both will do.

Thanks in advance.
Last edited by akash_rawal on Tue 14 Jun 2011, 05:36, edited 1 time in total.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

Menu -> Multimedia -> Pburn has Disc info under the Tools tab. It might not be exactly what you're looking for, but maybe it points in the right direction?

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#3 Post by 8-bit »

Well, how about bad information?
I have some memorex DVD+R optical disks of 4.7 gig capacity.
I insert one in the DVD drive.
The icon for it appears on the desktop.
So far, so good.
But a mouse over shows the capacity as 2.2 gig.
Then I open Pburn.
Lo and behold, the capacity in Pburn is listed correctly at 4.7 gig.

Does this mean there is an error in how the desktop drive icon software package determines capacity of a device?

Do you get the same results as I do?

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#4 Post by akash_rawal »

Flash wrote:Menu -> Multimedia -> Pburn has Disc info under the Tools tab. It might not be exactly what you're looking for, but maybe it points in the right direction?
I searched all the sources of PBurn and it seemed as if each mechanism was widely distributed over several files. I failed to track how that info was gathered.

The info that PBurn gives was almost what I was searching for, only thing that was missing was if there is some free space then if the media recordable or rewritable.

Anyways I found a part myself.
The following command can find what type of DVD is present:

Code: Select all

# dvd+rw-mediainfo <device>
cddetect can find what kind of data is present in a CD.
Now all that is missing is how to detect type of CD (i.e. CD-ROM, CD-RW etc).
Does anyone know?
8-bit wrote: Well, how about bad information?
I have some memorex DVD+R optical disks of 4.7 gig capacity.
I insert one in the DVD drive.
The icon for it appears on the desktop.
So far, so good.
But a mouse over shows the capacity as 2.2 gig.
Then I open Pburn.
Lo and behold, the capacity in Pburn is listed correctly at 4.7 gig.

Does this mean there is an error in how the desktop drive icon software package determines capacity of a device?

Do you get the same results as I do?
Usually drive icon shows amount of data stored in the disk.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#5 Post by akash_rawal »

I found a program called cdrdao that can provide info about a CD.

Code: Select all

cdrdao disk-info --device <device>

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#6 Post by disciple »

Oh, a pity I didn't see this at the time.
For future reference, you should be able to find the information you need using cd-info and dvd+rw-mediainfo, which are included in Puppy.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Post Reply