Wednesday, January 04, 2006

Slick way to calc free space in windows

I learned today there is a FlieOp module that allows you to identify how much free space there remains on a drive in windows through perl

If one were to make use of the following:
use Win32::FileOp qw(GetDiskFreeSpace);

$freeSpaceForUser = GetDiskFreeSpace 'C:';
$total = ($freeSpaceForUser / 1024) / 1024;
print "$total\n";

It will print out how many megs are free :D

0 Comments:

Post a Comment

<< Home