Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to know if there is a CD in CD drive

Status
Not open for further replies.

pengpeng

Programmer
Dec 18, 2002
6
US
I need to write a bash script for backup. I should get the information if there is a CD-RW in the CD drive and how much the space is available on this CD-RW. I can not find the commands to fullfil the requirement. Anyone know how to get the information I need?

Thanks.

Pengpeng
 
I don't know, but I would guess that cdrecord may have an option to check for this kind of info? Sorry if that's no help; just thought I would throw out a suggestion.

-Venkman
 

Well, under all normal operating circumstances if the drive is mounted, it has a CD, else mount would fail.

Another thing, once mounted, the CD will not eject, so there is no real way (aside from forcing the tray open) to take a CD out while it is mounted.

You can type: mount at the shell prompt to see what is mounted.

Good luck!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top