swampyankee has asked for the wisdom of the Perl Monks concerning the following question:
I am an unfortunate windows programmer fairly new to the grand world of Perl. My question, and request for knowledge is this: Is there any way, within Perl and either Win32 or Win32API of checking to see if a user has a CD-RW or CD-R drive attached to his/her machine? I don't care if it's kludgy; the only way I can see to do this is to find the CD drive using
while(@drives and (not $is_cdrw))
{
my $drive = pop(@drives);
if(GetDriveType($drive) eq DRIVE_CDROM)
{
# see if it's writable by trying to write a file....
$ok = CreateFile($drive + "void");
}
}
I am seeking a somewhat less clunky than the above...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to check to see if a CD drive is a writable on windows?
by BrowserUk (Patriarch) on Oct 03, 2005 at 20:43 UTC | |
by swampyankee (Parson) on Oct 04, 2005 at 02:06 UTC | |
|
Re: How to check to see if a CD drive is a writable on windows?
by terra incognita (Pilgrim) on Oct 04, 2005 at 16:24 UTC |