Under Linux, is there any way to get a yes/no answer to whether or a CD/DVD drive contains a disc which isn't mounted but which can be mounted or written to?
If there is just one drive, you could call
cdrecord -v -minfo
If there is a medium inside, you get the media information.
If there is no medium inside, you get an error message with no media.
If you have more than one drive, you need to specify the
dev= parameter, see man page: http://schilytools.sourceforge.net/man/man1/cdrecord.1.html