Just for information...this works on Win2K also.

 -Kevin

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> ]On Behalf
> Of Eloy A. Gonzales
> Sent: Friday, May 12, 2000 3:16 PM
> To: Perl-Win32-Users Mailing List
> Subject: Re: How can Perl identify all resident drives ???
> 
> 
> Can't claim to all the above requirements, but this works on 
> win 9x and NT for
> me:
> use Win32API::File  qw( :ALL );
> sub Win32GetDrives {
>   my ($self) = @_;
>   my %drivetypes = qw(
>       0 <Unknown> 1 <None> 2 <Removable> 3 <Fixed>
>     4 <Remote> 5 <CDRom> 6 <RamDisk>
>       );
>   my %drives;
>   my $dt;
>   my @roots= getLogicalDrives();
>   foreach my $drive ( @roots ) {
>     $drive =~ s%\\%/%;
>     $dt = GetDriveType( $drive );
>     $drives{$drive}=$drivetypes{$dt} if ( $dt != 1);
>   }
>   return %drives;
> }
> 
> my %drives = Win32GetDrives();
> my $message;
> foreach $drive ( sort keys %drives ) {
>               print $drive ." = " . $drives{$drive} . "\n";
> }
> 
> Hope this helps.
> 
> ~=============================================================
> ========~
> ~[  Eloy A. Gonzales                     Voice: (505) 
> 844-1063       ]~
> ~[  Sandia National Laboratories         Fax:   (505) 
> 844-7059       ]~
> ~[  Org 05743 MS 0965                    email: 
> [EMAIL PROTECTED]   ]~
> ~[  Albuquerque, New Mexico 87185-0965                        
>        ]~ 
> ~=============================================================
> ========~
> 
> 
> 
> 
> ---
> You are currently subscribed to perl-win32-users as: 
> [EMAIL PROTECTED]
> To unsubscribe, forward this message to
>          [EMAIL PROTECTED]
> For non-automated Mailing List support, send email to  
>          [EMAIL PROTECTED]

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to