CD-R or CD-RW ?

Discussion in 'Perl Misc' started by kielhd, Apr 1, 2005.

  1. kielhd

    kielhd Guest

    Hi NG,

    is there a way for Perl to find out, if a CD is a CD-R or a CD-RW?

    TIA,
    Henning
     
    kielhd, Apr 1, 2005
    #1
    1. Advertising

  2. kielhd wrote:

    > is there a way for Perl to find out, if a CD is a CD-R or a CD-RW?


    If your operating system provides and interface that makes this
    information available to applications then no doubt you can get at it
    with Perl.

    For example on Unix-like OSs there's probably an IOCTL you can use on
    the device file correspoding to the CD.
     
    Brian McCauley, Apr 1, 2005
    #2
    1. Advertising

  3. Also sprach Brian McCauley:

    > kielhd wrote:
    >
    >> is there a way for Perl to find out, if a CD is a CD-R or a CD-RW?

    >
    > If your operating system provides and interface that makes this
    > information available to applications then no doubt you can get at it
    > with Perl.
    >
    > For example on Unix-like OSs there's probably an IOCTL you can use on
    > the device file correspoding to the CD.


    Is the OP talking about the disc or the drive? Linux (and therefore
    Solaris probably too) has the CDROM_GET_CAPABILITY ioctl which, among
    other things, tells whether a drive can write CD-Rs, CD-RWs, DVD-Rs
    and/or DVD-RWs. But I know of no ioctl that would tell me whether an
    inserted disc is CD-R or CD-RW.

    Tassilo
    --
    use bigint;
    $n=71423350343770280161397026330337371139054411854220053437565440;
    $m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
     
    Tassilo v. Parseval, Apr 2, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page