NAME

Win32::DriveInfo - drives on Win32 systems

SYNOPSIS

    use Win32::DriveInfo;
    
    ($SectorsPerCluster,
     $BytesPerSector,
     $NumberOfFreeClusters,
     $TotalNumberOfClusters,
     $FreeBytesAvailableToCaller,
     $TotalNumberOfBytes,
     $TotalNumberOfFreeBytes) = Win32::DriveInfo::DriveSpace('f');
    
     $TotalNumberOfFreeBytes = (Win32::DriveInfo::DriveSpace('c:'))[6];
    
     $TotalNumberOfBytes = (Win32::DriveInfo::DriveSpace("\\\\serv\\share"))[5];
    
     @drives = Win32::DriveInfo::DrivesInUse();
    
     @freelet = Win32::DriveInfo::FreeDriveLetters();
    
     $type = Win32::DriveInfo::DriveType('a');
    
     ($VolumeName,
      $VolumeSerialNumber,
      $MaximumComponentLength,
      $FileSystemName, @attr) = Win32::DriveInfo::VolumeInfo('g');
    
     ($MajorVersion, $MinorVersion, $BuildNumber,
      $PlatformId, $BuildStr) = Win32::DriveInfo::GetVersionEx();
    
     # check is your CD-ROM loaded
     $CDROM = ( grep { Win32::DriveInfo::DriveType($_) == 5 }
        Win32::DriveInfo::DrivesInUse() )[0];
     $CD_inside = Win32::DriveInfo::IsReady($CDROM);

ABSTRACT

With this module you can get total/free space on Win32 drives, volume names, architecture, filesystem type, drive attributes, list of all available drives and free drive-letters. Additional function to determine Windows version info.

The intention was to have a part of Dave Roth's Win32::AdminMisc functionality on Win95/98.

The current version of Win32::DriveInfo is available at:

  http://base.dux.ru/guest/fno/perl/

DESCRIPTION

Nothing is exported by default. All functions return undef on errors.

INSTALLATION

As this is just a plain module no special installation is needed. Just put it into /Win32 subdir somewhere in your @INC. The standard

 Makefile.PL
 make
 make test
 make install

installation procedure is provided. In addition

 make html

will produce the HTML-docs.

This module requires

Win32::API module by Aldo Calpini

CAVEATS

This module has been created and tested in a Win95 environment on GS port of Perl 5.004_02. As it uses Win32::API module I expect it would work fine with other ports like ActiveState if Win32::API (API.dll) is compiled for this port.

CHANGES

 0.02 - Austin Durbin <adurbin@earthlink.net> tested module on Win NT
        and discovered small bug in UNC paths handling. Fixed.
        Thanks Austin!
 
 0.03 - fixed bug that returned incorrect values for volumes that are
        larger than 0x7fffffff bytes (2 GB). Approved on Win98 with FAT32.
 
 0.04 - added IsReady() function and MakeMaker compartible distribution.
        Empty SerialNumber fixed. Now it's empty string, previously it
        was evaluated to 0000:0000.
        Minor enhancements.
 
 0.05 - test.pl fixed, other minor fixes. 
        The last 0.0x version before the major update (soon!)
 
 0.06 - test.pl fixed more ;-)

BUGS

DriveSpace ( ) returns incorrect $NumberOfFreeClusters, $TotalNumberOfClusters values on the large ( >2M ) drives. Dunno whether somebody use these values or not but I'll try to fix this in the next release.

Please report if any bugs.

VERSION

This man page documents Win32::DriveInfo version 0.06

February 19, 2001

AUTHOR

Mike Blazer <blazer@mail.nevalink.ru >

COPYRIGHT

Copyright (C) 1998-2001 by Mike Blazer. All rights reserved.

LICENSE

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 311:

You can't have =items (as at line 315) unless the first thing after the =over is an =item