Hi
I'd like to know if cdrecord could be easily modified to return some
meaningful status codes when things go wrong, but more particularly, whether
cdrecord could return an exit value when there is no disk in the drive. The
man pages don't really indicate that there are specific error codes returned
in specific circumstances, and a quick look at the source would tend to
suggest that basically either 0 or -1 are returned by the exit() calls.
My scenario:
Intel Pentium 166/MMX with 64Mb RAM running RedHat Linux 7.0, kernel
2.2.16-22
Adaptec 2940 SCSI card
Plextor PX-R820T SCSI writer
cdrecord 1.9 installed and working just fine at 2, 4 and 8X write speeds
from an ISO file.
All this replaces a much older Linux box (486/100) using Red Hat Linux
release 3.0.3 (Picasso), running kernel 2.0.34. The former system
administrator had installed cdwrite 2.0 and mkisofs, plus a modified version
of cdwrite that could detect a CD in the drive. That box suffered some
lightening damage and the SCSI hard drive died. So, I have decided to
re-build the system on later generation hardware and of course I want to use
the latest Linux rather than "living in the past"
My CD-writer machine will be on our LAN, and running Samba, NFS and FTP to
allow files from other PCs or servers to be built into ISO images with
mkisofs.
The whole CD generation and recording process will be under the control of a
simple daemon script (inherited from the old 486 Linux box) which basically
looks for a user created lock file, then allows exclusive access by that
user to a "cd image" sub-directory on the Linux box.
The user can specify some options about what they want to do with the CD
e.g. copy from another CD, how many copies to build, plus volume label,
bibliography, etc (all the things that mkisofs supports for ISO9600
CD-ROMs).
If the user is creating their own CD, then once they are finished copying
files, they create a start file, and then the daemon then uses mkisofs to
turn the users files into an ISO9660 file
If the user is copying a CD, then they insert it into the drive, create the
start file, and the daemon then grabs the CD data using a simple dd command.
So, there is an ISO9660 formatted file left on the Linxu box hard drive.
Messages to the user are displayed using xmessage and also an xterm screen
with piped tty information coming from mkisofs and cdrecord. A message log
file is also recorded so the user can see what's going on at any point in
time.
Once the ISO file has either been created or extracted, then cdrecord is
used to burn it.
Of course, a few things have to be checked. First, we want to ensure that a
non-finalised disk with data on it is not already in the drive. It seems
that both Linux and Windows 95 have difficulty dealing with multi-sessions
CDs (not sure about Win 98/ME) and always look at the last session only. I
got burnt fingers on the old 486 once because the disk I was going to copy
was not finalised, and so a new session got written, making the old one
"invisible" on Windows 95 - I quickly added an extra "eject" command into
the daemon script to ensure the disk that was being copied from (or was just
written when multiple copies of an existing CD were being requested).
So, back to my request:
It would be good if cdrecord could have an extra couple of command line
switches that allowed the following (of course "dev=x,y,z" is assumed, or
the environment strings are set already):
cdrecord -diskindrive : Returns 0 if there is a disk in the drive, or -1 if
the drive is empty
Ideally, it needs to be able to do this without trying to load a disk if the
try is open (or else it might re-load the disk it's just ejected !) Perhaps
it could try to read the ATIP information to determine what sort of disk is
there (if one is in the drive).
cdrecord -diskempty : Returns 0 if there is a disk in the drive and it's
empty, -1 if there's a disk in the drive and it has no TOC written, and -2
if there's a disk in the drive with a TOC written (and maybe -3 if there's a
disk in the drive with a TOC written but is finalised so no more data can be
added anyhow).
For my purpose, I am only interested in writing to totally blank disks, not
adding sessions to existing ones, but perhaps others want to be able to
determine more.
As a related question, can you determine whether a disk is a pre-pressed
disk or a CD-R or CD-RW disk ? Obviously there's no point trying to burn a
pre-pressed CD-ROM ! Does the ATIP information give clues for this ?
I am not a SCSI or CD-R expert, just a user who wants to get a system going.
But I'm glad to try and write some code if Joerg is interested in
considering it for the next cdrecord release.
Apologies for the long-winded e-mail. I hope you can understand my request
and the motivation behind it.
Regards
Jason Armistead
Senior Systems and Software Engineer
Continuation Engineering
OTIS Minto, Australia
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]