in reply to Determine if a win32 drive is mapped or local
so DRIVE_FIXED or DRIVE_RAMDISK means you should have no problem accessing it. Other types might fail or take a while. Lots of other goodies in Win32API::File (for example, if you want to see if there is any media in drive) which comes standard with modern Perls. - tye (but my friends call me "Tye")use strict; use Win32API::File qw( :DRIVE_ GetDriveType ); my $drive= "Y:"; my $type= GetDriveType($drive); if( DRIVE_REMOTE == $type ) { warn "Drive $drive is remote.\n"; } elsif( DRIVE_FIXED == $type ) { warn "Drive $drive is local harddisk.\n"; } elsif( DRIVE_CDROM == $type ) { warn "Drive $drive is local CD-ROM.\n"; } elsif( DRIVE_REMOVABLE == $type ) { warn "Drive $drive is local but media my not be present.\n"; } elsif( DRIVE_RAMDISK == $type ) { warn "Drive $drive is memory-resident virtual.\n"; } else { warn "Drive $drive is probably invalid.\n"; }
|
|---|