[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: check-debian-cd 1.10



   > if /dev/cdroms/ exists
   >    read from all files there
   > else if /dev/cdrom is readable
   >    read from there
   
   if devfs doesn't exist, you can check /proc for cdrom drives and/or
   try /dev/hd[a-f] and /dev/scd[0-f].

I found out that I can find all the ide CD drives:

for d in all symlinks under /proc/ide
    if $(cat d/media) = "cdrom"
       it is a CD

But I have no similar method  for finding out whether /dev/scd* is there
or not.  On  my system, I can  read them and get EOF  (same for /dev/hdc
when there is no CD in the  tray).  Is this a reasonable way of probing?
If yes, i'd do:

if /dev/cdroms/ exists
   read from all files there
else 
   for d in all symlinks under /proc/ide
      if $(cat d/media) = "cdrom"
         read from d
   for d in /dev/scd*
      read from d
if all previous reads failed and /dev/cdrom is there
   read from it

Where `read from' means:

if Volume ID is not null
   read the whole disc



Reply to: