Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Is there any module to get the cdrom infomation?

Reply
Thread Tools

Is there any module to get the cdrom infomation?

 
 
lofenee
Guest
Posts: n/a
 
      07-29-2008
I want to check whether a cdrom node under /dev actually exists.



 
Reply With Quote
 
 
 
 
npc
Guest
Posts: n/a
 
      07-29-2008
On Tue, 29 Jul 2008 10:35:29 +0800, lofenee wrote:

> I want to check whether a cdrom node under /dev actually exists.


search cpan for 'cdrom.' there appear to be several.

perldoc -q cpan
 
Reply With Quote
 
 
 
 
O
Guest
Posts: n/a
 
      07-29-2008
On Jul 29, 2:35 pm, "lofenee" <(E-Mail Removed)> wrote:
> I want to check whether a cdrom node under /dev actually exists.


Win32::AdminMisc

GetDrives([$Type])

This will return an array of drive roots. If no parameters are passed
then the list will be all drives (cdroms, floppy, fixed, net, etc.).
If you specify $Type the list will only contain drive roots that are
of the specified type.
The types are:

DRIVE_FIXED
DRIVE_REMOVABLE
DRIVE_REMOTE
DRIVE_CDROM
DRIVE_RAMDISK

Example:

@Drives = Win32::AdminMisc::GetDrives();
@CDROMs = Win32::AdminMisc::GetDrives( DRIVE_CDROM );
 
Reply With Quote
 
Joost Diepenmaat
Guest
Posts: n/a
 
      07-29-2008
"lofenee" <(E-Mail Removed)> writes:

> I want to check whether a cdrom node under /dev actually exists.


Well, the *node* exists if "-e $path_to_node" returns true. Do you
also care if there is an actual drive there or if there's a readable
drive in the disc?

I'm assuming linux behaviour, here.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
 
Reply With Quote
 
Jens Thoms Toerring
Guest
Posts: n/a
 
      07-29-2008
O <(E-Mail Removed)> wrote:
> On Jul 29, 2:35 pm, "lofenee" <(E-Mail Removed)> wrote:
> > I want to check whether a cdrom node under /dev actually exists.


> Win32::AdminMisc


> GetDrives([$Type])


Do you guys on Windows nowadays also have a /dev directory with
device files?
Just curious, Jens
--
\ Jens Thoms Toerring ___ http://www.velocityreviews.com/forums/(E-Mail Removed)
\__________________________ http://toerring.de
 
Reply With Quote
 
RedGrittyBrick
Guest
Posts: n/a
 
      07-30-2008
Joost Diepenmaat wrote:
> "lofenee" <(E-Mail Removed)> writes:
>
>> I want to check whether a cdrom node under /dev actually exists.

>
> Well, the *node* exists if "-e $path_to_node" returns true. Do you
> also care if there is an actual drive there or if there's a readable
> drive in the disc?
>
> I'm assuming linux behaviour, here.
>


In which case reading 'files' like /proc/ide/hdc/model might help.

--
RGB
 
Reply With Quote
 
cmic
Guest
Posts: n/a
 
      07-30-2008
Hello

On 29 juil, 04:35, "lofenee" <(E-Mail Removed)> wrote:
> I want to check whether a cdrom node under /dev actually exists.


maybe ioctl could help ?
(quick and dirty, sorry ...)

.....
open(CDROM, "< /dev/cdrom");
$media = ioctl(CDROM, 0x5327, $status='');
close(CDROM);

if($media eq 101) {
#media is present whith info
....
}

Regards
--
michel marcon aka cmic

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
I am getting loads of spam by e-mail.Most of it is not even addressed to me so god knows how I am receiving it. Any ideas . Is there a spam guard available on blueyonder? How do I get it on my system if there is?Cheers GW Geoff/Elaine Computer Support 11 11-16-2004 11:17 PM
Help needed reinstalling Win98 on modular laptop Floppy OR CDrom not both. No bios support booting CDROM. Arawak Computer Support 4 12-20-2003 03:11 AM
Re: WinDVD 3&5 say "Cann't find any cdrom/dvdrom device" - but File Manager can read all files on the drive! Steve(JazzHunter) DVD Video 0 08-13-2003 04:44 AM
Re: WinDVD 3&5 say "Cann't find any cdrom/dvdrom device" - but File Manager can read all files on the drive! Just a friend DVD Video 0 08-12-2003 01:54 PM



Advertisments