>From: "Armistead, Jason" <[EMAIL PROTECTED]>
>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.
Cdrecord returns errno on errors if available (else -1).
>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
readcd dev=6,0 sectors=0-0 f=/dev/null 2>&1 > /dev/null
returns 0 if a disk is present.
>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).
If there is a disk and cdrecord -toc gives no track list, then the disk is empty.
J�rg
EMail:[EMAIL PROTECTED] (home) J�rg Schilling D-13353 Berlin
[EMAIL PROTECTED] (uni) If you don't have iso-8859-1
[EMAIL PROTECTED] (work) chars I am J"org Schilling
URL: http://www.fokus.gmd.de/usr/schilling ftp://ftp.fokus.gmd.de/pub/unix
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]